source: trunk/doc/html/qtoolbox.html@ 190

Last change on this file since 190 was 190, checked in by rudi, 14 years ago

reference documentation added

File size: 14.2 KB
Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/widgets/qtoolbox.cpp:249 -->
3<html>
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
6<title>QToolBox Class</title>
7<style type="text/css"><!--
8fn { margin-left: 1cm; text-indent: -1cm; }
9a:link { color: #004faf; text-decoration: none }
10a:visited { color: #672967; text-decoration: none }
11body { background: #ffffff; color: black; }
12--></style>
13</head>
14<body>
15
16<table border="0" cellpadding="0" cellspacing="0" width="100%">
17<tr bgcolor="#E5E5E5">
18<td valign=center>
19 <a href="index.html">
20<font color="#004faf">Home</font></a>
21 | <a href="classes.html">
22<font color="#004faf">All&nbsp;Classes</font></a>
23 | <a href="mainclasses.html">
24<font color="#004faf">Main&nbsp;Classes</font></a>
25 | <a href="annotated.html">
26<font color="#004faf">Annotated</font></a>
27 | <a href="groups.html">
28<font color="#004faf">Grouped&nbsp;Classes</font></a>
29 | <a href="functions.html">
30<font color="#004faf">Functions</font></a>
31</td>
32<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QToolBox Class Reference</h1>
33
34<p>The QToolBox class provides a column of tabbed widget
35items.
36<a href="#details">More...</a>
37<p><tt>#include &lt;<a href="qtoolbox-h.html">qtoolbox.h</a>&gt;</tt>
38<p>Inherits <a href="qframe.html">QFrame</a>.
39<p><a href="qtoolbox-members.html">List of all member functions.</a>
40<h2>Public Members</h2>
41<ul>
42<li class=fn><a href="#QToolBox"><b>QToolBox</b></a> ( QWidget&nbsp;*&nbsp;parent = 0, const&nbsp;char&nbsp;*&nbsp;name = 0, WFlags&nbsp;f = 0 )</li>
43<li class=fn>int <a href="#addItem-2"><b>addItem</b></a> ( QWidget&nbsp;*&nbsp;w, const&nbsp;QString&nbsp;&amp;&nbsp;label )</li>
44<li class=fn>int <a href="#addItem"><b>addItem</b></a> ( QWidget&nbsp;*&nbsp;item, const&nbsp;QIconSet&nbsp;&amp;&nbsp;iconSet, const&nbsp;QString&nbsp;&amp;&nbsp;label )</li>
45<li class=fn>int <a href="#insertItem-2"><b>insertItem</b></a> ( int&nbsp;index, QWidget&nbsp;*&nbsp;item, const&nbsp;QString&nbsp;&amp;&nbsp;label )</li>
46<li class=fn>int <a href="#insertItem"><b>insertItem</b></a> ( int&nbsp;index, QWidget&nbsp;*&nbsp;item, const&nbsp;QIconSet&nbsp;&amp;&nbsp;iconSet, const&nbsp;QString&nbsp;&amp;&nbsp;label )</li>
47<li class=fn>int <a href="#removeItem"><b>removeItem</b></a> ( QWidget&nbsp;*&nbsp;item )</li>
48<li class=fn>void <a href="#setItemEnabled"><b>setItemEnabled</b></a> ( int&nbsp;index, bool&nbsp;enabled )</li>
49<li class=fn>bool <a href="#isItemEnabled"><b>isItemEnabled</b></a> ( int&nbsp;index ) const</li>
50<li class=fn>void <a href="#setItemLabel"><b>setItemLabel</b></a> ( int&nbsp;index, const&nbsp;QString&nbsp;&amp;&nbsp;label )</li>
51<li class=fn>QString <a href="#itemLabel"><b>itemLabel</b></a> ( int&nbsp;index ) const</li>
52<li class=fn>void <a href="#setItemIconSet"><b>setItemIconSet</b></a> ( int&nbsp;index, const&nbsp;QIconSet&nbsp;&amp;&nbsp;iconSet )</li>
53<li class=fn>QIconSet <a href="#itemIconSet"><b>itemIconSet</b></a> ( int&nbsp;index ) const</li>
54<li class=fn>void <a href="#setItemToolTip"><b>setItemToolTip</b></a> ( int&nbsp;index, const&nbsp;QString&nbsp;&amp;&nbsp;toolTip )</li>
55<li class=fn>QString <a href="#itemToolTip"><b>itemToolTip</b></a> ( int&nbsp;index ) const</li>
56<li class=fn>QWidget * <a href="#currentItem"><b>currentItem</b></a> () const</li>
57<li class=fn>void <a href="#setCurrentItem"><b>setCurrentItem</b></a> ( QWidget&nbsp;*&nbsp;item )</li>
58<li class=fn>int <a href="#currentIndex"><b>currentIndex</b></a> () const</li>
59<li class=fn>QWidget * <a href="#item"><b>item</b></a> ( int&nbsp;index ) const</li>
60<li class=fn>int <a href="#indexOf"><b>indexOf</b></a> ( QWidget&nbsp;*&nbsp;item ) const</li>
61<li class=fn>int <a href="#count"><b>count</b></a> () const</li>
62</ul>
63<h2>Public Slots</h2>
64<ul>
65<li class=fn>void <a href="#setCurrentIndex"><b>setCurrentIndex</b></a> ( int&nbsp;index )</li>
66</ul>
67<h2>Signals</h2>
68<ul>
69<li class=fn>void <a href="#currentChanged"><b>currentChanged</b></a> ( int&nbsp;index )</li>
70</ul>
71<h2>Properties</h2>
72<ul>
73<li class=fn>int <a href="#count-prop"><b>count</b></a>&nbsp;- the number of items contained in the toolbox &nbsp;<em>(read only)</em></li>
74<li class=fn>int <a href="#currentIndex-prop"><b>currentIndex</b></a>&nbsp;- the index of the current item, or -1 if the toolbox is empty</li>
75</ul>
76<h2>Protected Members</h2>
77<ul>
78<li class=fn>virtual void <a href="#itemInserted"><b>itemInserted</b></a> ( int&nbsp;index )</li>
79<li class=fn>virtual void <a href="#itemRemoved"><b>itemRemoved</b></a> ( int&nbsp;index )</li>
80</ul>
81<hr><a name="details"></a><h2>Detailed Description</h2>
82
83
84<p> The QToolBox class provides a column of tabbed widget
85items.
86<p>
87
88<p> A toolbox is a widget that displays a column of tabs one above the
89other, with the current item displayed below the current tab.
90Every tab has an index position within the column of tabs. A tab's
91item is a <a href="qwidget.html">QWidget</a>.
92<p> Each item has an <a href="#itemLabel">itemLabel</a>(), an optional icon, <a href="#itemIconSet">itemIconSet</a>(), an
93optional <a href="#itemToolTip">itemToolTip</a>(), and a <a href="#item">widget</a>. The
94item's attributes can be changed with <a href="#setItemLabel">setItemLabel</a>(),
95<a href="#setItemIconSet">setItemIconSet</a>() and <a href="#setItemToolTip">setItemToolTip</a>().
96<p> Items are added using <a href="#addItem">addItem</a>(), or inserted at particular
97positions using <a href="#insertItem">insertItem</a>(). The total number of items is given
98by <a href="#count">count</a>(). Items can be deleted with delete, or removed from the
99toolbox with <a href="#removeItem">removeItem</a>(). Combining removeItem() and insertItem()
100allows to move items to different positions.
101<p> The current item widget is returned by <a href="#currentItem">currentItem</a>() and set with
102<a href="#setCurrentItem">setCurrentItem</a>(). If you prefer you can work in terms of indexes
103using <a href="#currentIndex">currentIndex</a>(), <a href="#setCurrentIndex">setCurrentIndex</a>(), <a href="#indexOf">indexOf</a>() and <a href="#item">item</a>().
104<p> The <a href="#currentChanged">currentChanged</a>() signal is emitted when the current item is
105changed.
106<p> <p>See also <a href="qtabwidget.html">QTabWidget</a> and <a href="advanced.html">Advanced Widgets</a>.
107
108<hr><h2>Member Function Documentation</h2>
109<h3 class=fn><a name="QToolBox"></a>QToolBox::QToolBox ( <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;parent = 0, const&nbsp;char&nbsp;*&nbsp;name = 0, WFlags&nbsp;f = 0 )
110</h3>
111Constructs a toolbox called <em>name</em> with parent <em>parent</em> and flags <em>f</em>.
112
113<h3 class=fn>int <a name="addItem"></a>QToolBox::addItem ( <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;item, const&nbsp;<a href="qiconset.html">QIconSet</a>&nbsp;&amp;&nbsp;iconSet, const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;label )
114</h3>
115
116Adds the widget <em>item</em> in a new tab at bottom of the toolbox. The
117new tab's label is set to <em>label</em>, and the <em>iconSet</em> is
118displayed to the left of the <em>label</em>. Returns the new tab's index.
119
120<h3 class=fn>int <a name="addItem-2"></a>QToolBox::addItem ( <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;w, const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;label )
121</h3>
122
123This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
124<p> Adds the widget <em>w</em> in a new tab at bottom of the toolbox. The
125new tab's label is set to <em>label</em>. Returns the new tab's index.
126
127<h3 class=fn>int <a name="count"></a>QToolBox::count () const
128</h3><p>Returns the number of items contained in the toolbox.
129See the <a href="qtoolbox.html#count-prop">"count"</a> property for details.
130<h3 class=fn>void <a name="currentChanged"></a>QToolBox::currentChanged ( int&nbsp;index )<tt> [signal]</tt>
131</h3>
132
133<p> This signal is emitted when the current item changed. The new
134current item's index is passed in <em>index</em>, or -1 if there is no
135current item.
136
137<h3 class=fn>int <a name="currentIndex"></a>QToolBox::currentIndex () const
138</h3><p>Returns the index of the current item, or -1 if the toolbox is empty.
139See the <a href="qtoolbox.html#currentIndex-prop">"currentIndex"</a> property for details.
140<h3 class=fn><a href="qwidget.html">QWidget</a>&nbsp;* <a name="currentItem"></a>QToolBox::currentItem () const
141</h3>
142Returns the toolbox's current item, or 0 if the toolbox is empty.
143
144<h3 class=fn>int <a name="indexOf"></a>QToolBox::indexOf ( <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;item ) const
145</h3>
146Returns the index of item <em>item</em>, or -1 if the item does not
147exist.
148
149<h3 class=fn>int <a name="insertItem"></a>QToolBox::insertItem ( int&nbsp;index, <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;item, const&nbsp;<a href="qiconset.html">QIconSet</a>&nbsp;&amp;&nbsp;iconSet, const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;label )
150</h3>
151Inserts the widget <em>item</em> at position <em>index</em>, or at the bottom
152of the toolbox if <em>index</em> is out of range. The new item's label
153is set to <em>label</em>, and the <em>iconSet</em> is displayed to the left of
154the <em>label</em>. Returns the new item's index.
155
156<h3 class=fn>int <a name="insertItem-2"></a>QToolBox::insertItem ( int&nbsp;index, <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;item, const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;label )
157</h3>
158
159This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
160<p> Inserts the widget <em>item</em> at position <em>index</em>, or at the bottom
161of the toolbox if <em>index</em> is out of range. The new item's label is
162set to <em>label</em>. Returns the new item's index.
163
164<h3 class=fn>bool <a name="isItemEnabled"></a>QToolBox::isItemEnabled ( int&nbsp;index ) const
165</h3>
166Returns TRUE if the item at position <em>index</em> is enabled; otherwise returns FALSE.
167
168<h3 class=fn><a href="qwidget.html">QWidget</a>&nbsp;* <a name="item"></a>QToolBox::item ( int&nbsp;index ) const
169</h3>
170Returns the item at position <em>index</em>, or 0 if there is no such
171item.
172
173<h3 class=fn><a href="qiconset.html">QIconSet</a> <a name="itemIconSet"></a>QToolBox::itemIconSet ( int&nbsp;index ) const
174</h3>
175Returns the icon of the item at position <em>index</em>, or a null
176icon if <em>index</em> is out of range.
177
178<h3 class=fn>void <a name="itemInserted"></a>QToolBox::itemInserted ( int&nbsp;index )<tt> [virtual protected]</tt>
179</h3>
180This virtual handler is called after a new item was added or
181inserted at position <em>index</em>.
182
183<h3 class=fn><a href="qstring.html">QString</a> <a name="itemLabel"></a>QToolBox::itemLabel ( int&nbsp;index ) const
184</h3>
185Returns the label of the item at position <em>index</em>, or a null string if
186<em>index</em> is out of range.
187
188<h3 class=fn>void <a name="itemRemoved"></a>QToolBox::itemRemoved ( int&nbsp;index )<tt> [virtual protected]</tt>
189</h3>
190This virtual handler is called after an item was removed from
191position <em>index</em>.
192
193<h3 class=fn><a href="qstring.html">QString</a> <a name="itemToolTip"></a>QToolBox::itemToolTip ( int&nbsp;index ) const
194</h3>
195Returns the tooltip of the item at position <em>index</em>, or a null
196string if <em>index</em> is out of range.
197
198<h3 class=fn>int <a name="removeItem"></a>QToolBox::removeItem ( <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;item )
199</h3>
200Removes the widget <em>item</em> from the toolbox. Note that the widget
201is <em>not</em> deleted. Returns the removed widget's index, or -1 if
202the widget was not in this tool box.
203
204<h3 class=fn>void <a name="setCurrentIndex"></a>QToolBox::setCurrentIndex ( int&nbsp;index )<tt> [slot]</tt>
205</h3><p>Sets the index of the current item, or -1 if the toolbox is empty to <em>index</em>.
206See the <a href="qtoolbox.html#currentIndex-prop">"currentIndex"</a> property for details.
207<h3 class=fn>void <a name="setCurrentItem"></a>QToolBox::setCurrentItem ( <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;item )
208</h3>
209Sets the current item to be <em>item</em>.
210
211<h3 class=fn>void <a name="setItemEnabled"></a>QToolBox::setItemEnabled ( int&nbsp;index, bool&nbsp;enabled )
212</h3>
213If <em>enabled</em> is TRUE then the item at position <em>index</em> is enabled; otherwise item
214<em>index</em> is disabled.
215
216<h3 class=fn>void <a name="setItemIconSet"></a>QToolBox::setItemIconSet ( int&nbsp;index, const&nbsp;<a href="qiconset.html">QIconSet</a>&nbsp;&amp;&nbsp;iconSet )
217</h3>
218Sets the icon of the item at position <em>index</em> to <em>iconSet</em>.
219
220<h3 class=fn>void <a name="setItemLabel"></a>QToolBox::setItemLabel ( int&nbsp;index, const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;label )
221</h3>
222Sets the label of the item at position <em>index</em> to <em>label</em>.
223
224<h3 class=fn>void <a name="setItemToolTip"></a>QToolBox::setItemToolTip ( int&nbsp;index, const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;toolTip )
225</h3>
226Sets the tooltip of the item at position <em>index</em> to <em>toolTip</em>.
227
228<hr><h2>Property Documentation</h2>
229<h3 class=fn>int <a name="count-prop"></a>count</h3>
230<p>This property holds the number of items contained in the toolbox.
231<p>
232<p>Get this property's value with <a href="#count">count</a>().
233<h3 class=fn>int <a name="currentIndex-prop"></a>currentIndex</h3>
234<p>This property holds the index of the current item, or -1 if the toolbox is empty.
235<p>Set this property's value with <a href="#setCurrentIndex">setCurrentIndex</a>() and get this property's value with <a href="#currentIndex">currentIndex</a>().
236<p><p>See also <a href="#currentItem">currentItem</a>(), <a href="#indexOf">indexOf</a>(), and <a href="#item">item</a>().
237
238<!-- eof -->
239<hr><p>
240This file is part of the <a href="index.html">Qt toolkit</a>.
241Copyright &copy; 1995-2007
242<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
243<table width=100% cellspacing=0 border=0><tr>
244<td>Copyright &copy; 2007
245<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
246<td align=right><div align=right>Qt 3.3.8</div>
247</table></div></address></body>
248</html>
Note: See TracBrowser for help on using the repository browser.