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"><!--
|
---|
8 | fn { margin-left: 1cm; text-indent: -1cm; }
|
---|
9 | a:link { color: #004faf; text-decoration: none }
|
---|
10 | a:visited { color: #672967; text-decoration: none }
|
---|
11 | body { 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 Classes</font></a>
|
---|
23 | | <a href="mainclasses.html">
|
---|
24 | <font color="#004faf">Main 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 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
|
---|
35 | items.
|
---|
36 | <a href="#details">More...</a>
|
---|
37 | <p><tt>#include <<a href="qtoolbox-h.html">qtoolbox.h</a>></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 * parent = 0, const char * name = 0, WFlags f = 0 )</li>
|
---|
43 | <li class=fn>int <a href="#addItem-2"><b>addItem</b></a> ( QWidget * w, const QString & label )</li>
|
---|
44 | <li class=fn>int <a href="#addItem"><b>addItem</b></a> ( QWidget * item, const QIconSet & iconSet, const QString & label )</li>
|
---|
45 | <li class=fn>int <a href="#insertItem-2"><b>insertItem</b></a> ( int index, QWidget * item, const QString & label )</li>
|
---|
46 | <li class=fn>int <a href="#insertItem"><b>insertItem</b></a> ( int index, QWidget * item, const QIconSet & iconSet, const QString & label )</li>
|
---|
47 | <li class=fn>int <a href="#removeItem"><b>removeItem</b></a> ( QWidget * item )</li>
|
---|
48 | <li class=fn>void <a href="#setItemEnabled"><b>setItemEnabled</b></a> ( int index, bool enabled )</li>
|
---|
49 | <li class=fn>bool <a href="#isItemEnabled"><b>isItemEnabled</b></a> ( int index ) const</li>
|
---|
50 | <li class=fn>void <a href="#setItemLabel"><b>setItemLabel</b></a> ( int index, const QString & label )</li>
|
---|
51 | <li class=fn>QString <a href="#itemLabel"><b>itemLabel</b></a> ( int index ) const</li>
|
---|
52 | <li class=fn>void <a href="#setItemIconSet"><b>setItemIconSet</b></a> ( int index, const QIconSet & iconSet )</li>
|
---|
53 | <li class=fn>QIconSet <a href="#itemIconSet"><b>itemIconSet</b></a> ( int index ) const</li>
|
---|
54 | <li class=fn>void <a href="#setItemToolTip"><b>setItemToolTip</b></a> ( int index, const QString & toolTip )</li>
|
---|
55 | <li class=fn>QString <a href="#itemToolTip"><b>itemToolTip</b></a> ( int 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 * 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 index ) const</li>
|
---|
60 | <li class=fn>int <a href="#indexOf"><b>indexOf</b></a> ( QWidget * 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 index )</li>
|
---|
66 | </ul>
|
---|
67 | <h2>Signals</h2>
|
---|
68 | <ul>
|
---|
69 | <li class=fn>void <a href="#currentChanged"><b>currentChanged</b></a> ( int index )</li>
|
---|
70 | </ul>
|
---|
71 | <h2>Properties</h2>
|
---|
72 | <ul>
|
---|
73 | <li class=fn>int <a href="#count-prop"><b>count</b></a> - the number of items contained in the toolbox <em>(read only)</em></li>
|
---|
74 | <li class=fn>int <a href="#currentIndex-prop"><b>currentIndex</b></a> - 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 index )</li>
|
---|
79 | <li class=fn>virtual void <a href="#itemRemoved"><b>itemRemoved</b></a> ( int 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
|
---|
85 | items.
|
---|
86 | <p>
|
---|
87 |
|
---|
88 | <p> A toolbox is a widget that displays a column of tabs one above the
|
---|
89 | other, with the current item displayed below the current tab.
|
---|
90 | Every tab has an index position within the column of tabs. A tab's
|
---|
91 | item 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
|
---|
93 | optional <a href="#itemToolTip">itemToolTip</a>(), and a <a href="#item">widget</a>. The
|
---|
94 | item'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
|
---|
97 | positions using <a href="#insertItem">insertItem</a>(). The total number of items is given
|
---|
98 | by <a href="#count">count</a>(). Items can be deleted with delete, or removed from the
|
---|
99 | toolbox with <a href="#removeItem">removeItem</a>(). Combining removeItem() and insertItem()
|
---|
100 | allows 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
|
---|
103 | using <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
|
---|
105 | changed.
|
---|
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> * parent = 0, const char * name = 0, WFlags f = 0 )
|
---|
110 | </h3>
|
---|
111 | Constructs 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> * item, const <a href="qiconset.html">QIconSet</a> & iconSet, const <a href="qstring.html">QString</a> & label )
|
---|
114 | </h3>
|
---|
115 |
|
---|
116 | Adds the widget <em>item</em> in a new tab at bottom of the toolbox. The
|
---|
117 | new tab's label is set to <em>label</em>, and the <em>iconSet</em> is
|
---|
118 | displayed 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> * w, const <a href="qstring.html">QString</a> & label )
|
---|
121 | </h3>
|
---|
122 |
|
---|
123 | This 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
|
---|
125 | new 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.
|
---|
129 | See the <a href="qtoolbox.html#count-prop">"count"</a> property for details.
|
---|
130 | <h3 class=fn>void <a name="currentChanged"></a>QToolBox::currentChanged ( int index )<tt> [signal]</tt>
|
---|
131 | </h3>
|
---|
132 |
|
---|
133 | <p> This signal is emitted when the current item changed. The new
|
---|
134 | current item's index is passed in <em>index</em>, or -1 if there is no
|
---|
135 | current 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.
|
---|
139 | See the <a href="qtoolbox.html#currentIndex-prop">"currentIndex"</a> property for details.
|
---|
140 | <h3 class=fn><a href="qwidget.html">QWidget</a> * <a name="currentItem"></a>QToolBox::currentItem () const
|
---|
141 | </h3>
|
---|
142 | Returns 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> * item ) const
|
---|
145 | </h3>
|
---|
146 | Returns the index of item <em>item</em>, or -1 if the item does not
|
---|
147 | exist.
|
---|
148 |
|
---|
149 | <h3 class=fn>int <a name="insertItem"></a>QToolBox::insertItem ( int index, <a href="qwidget.html">QWidget</a> * item, const <a href="qiconset.html">QIconSet</a> & iconSet, const <a href="qstring.html">QString</a> & label )
|
---|
150 | </h3>
|
---|
151 | Inserts the widget <em>item</em> at position <em>index</em>, or at the bottom
|
---|
152 | of the toolbox if <em>index</em> is out of range. The new item's label
|
---|
153 | is set to <em>label</em>, and the <em>iconSet</em> is displayed to the left of
|
---|
154 | the <em>label</em>. Returns the new item's index.
|
---|
155 |
|
---|
156 | <h3 class=fn>int <a name="insertItem-2"></a>QToolBox::insertItem ( int index, <a href="qwidget.html">QWidget</a> * item, const <a href="qstring.html">QString</a> & label )
|
---|
157 | </h3>
|
---|
158 |
|
---|
159 | This 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
|
---|
161 | of the toolbox if <em>index</em> is out of range. The new item's label is
|
---|
162 | set to <em>label</em>. Returns the new item's index.
|
---|
163 |
|
---|
164 | <h3 class=fn>bool <a name="isItemEnabled"></a>QToolBox::isItemEnabled ( int index ) const
|
---|
165 | </h3>
|
---|
166 | Returns 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> * <a name="item"></a>QToolBox::item ( int index ) const
|
---|
169 | </h3>
|
---|
170 | Returns the item at position <em>index</em>, or 0 if there is no such
|
---|
171 | item.
|
---|
172 |
|
---|
173 | <h3 class=fn><a href="qiconset.html">QIconSet</a> <a name="itemIconSet"></a>QToolBox::itemIconSet ( int index ) const
|
---|
174 | </h3>
|
---|
175 | Returns the icon of the item at position <em>index</em>, or a null
|
---|
176 | icon if <em>index</em> is out of range.
|
---|
177 |
|
---|
178 | <h3 class=fn>void <a name="itemInserted"></a>QToolBox::itemInserted ( int index )<tt> [virtual protected]</tt>
|
---|
179 | </h3>
|
---|
180 | This virtual handler is called after a new item was added or
|
---|
181 | inserted at position <em>index</em>.
|
---|
182 |
|
---|
183 | <h3 class=fn><a href="qstring.html">QString</a> <a name="itemLabel"></a>QToolBox::itemLabel ( int index ) const
|
---|
184 | </h3>
|
---|
185 | Returns 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 index )<tt> [virtual protected]</tt>
|
---|
189 | </h3>
|
---|
190 | This virtual handler is called after an item was removed from
|
---|
191 | position <em>index</em>.
|
---|
192 |
|
---|
193 | <h3 class=fn><a href="qstring.html">QString</a> <a name="itemToolTip"></a>QToolBox::itemToolTip ( int index ) const
|
---|
194 | </h3>
|
---|
195 | Returns the tooltip of the item at position <em>index</em>, or a null
|
---|
196 | string 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> * item )
|
---|
199 | </h3>
|
---|
200 | Removes the widget <em>item</em> from the toolbox. Note that the widget
|
---|
201 | is <em>not</em> deleted. Returns the removed widget's index, or -1 if
|
---|
202 | the widget was not in this tool box.
|
---|
203 |
|
---|
204 | <h3 class=fn>void <a name="setCurrentIndex"></a>QToolBox::setCurrentIndex ( int 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>.
|
---|
206 | See 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> * item )
|
---|
208 | </h3>
|
---|
209 | Sets the current item to be <em>item</em>.
|
---|
210 |
|
---|
211 | <h3 class=fn>void <a name="setItemEnabled"></a>QToolBox::setItemEnabled ( int index, bool enabled )
|
---|
212 | </h3>
|
---|
213 | If <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 index, const <a href="qiconset.html">QIconSet</a> & iconSet )
|
---|
217 | </h3>
|
---|
218 | Sets 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 index, const <a href="qstring.html">QString</a> & label )
|
---|
221 | </h3>
|
---|
222 | Sets 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 index, const <a href="qstring.html">QString</a> & toolTip )
|
---|
225 | </h3>
|
---|
226 | Sets 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>
|
---|
240 | This file is part of the <a href="index.html">Qt toolkit</a>.
|
---|
241 | Copyright © 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 © 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>
|
---|