summaryrefslogtreecommitdiffstats
path: root/doc/html/qtoolbox.html
blob: d87097bc4d06322de28036228eaa026436d85371 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/widgets/qtoolbox.cpp:249 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>QToolBox Class</title>
<style type="text/css"><!--
fn { margin-left: 1cm; text-indent: -1cm; }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
body { background: #ffffff; color: black; }
--></style>
</head>
<body>

<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr bgcolor="#E5E5E5">
<td valign=center>
 <a href="index.html">
<font color="#004faf">Home</font></a>
 | <a href="classes.html">
<font color="#004faf">All&nbsp;Classes</font></a>
 | <a href="mainclasses.html">
<font color="#004faf">Main&nbsp;Classes</font></a>
 | <a href="annotated.html">
<font color="#004faf">Annotated</font></a>
 | <a href="groups.html">
<font color="#004faf">Grouped&nbsp;Classes</font></a>
 | <a href="functions.html">
<font color="#004faf">Functions</font></a>
</td>
<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>

<p>The QToolBox class provides a column of tabbed widget
items.
<a href="#details">More...</a>
<p><tt>#include &lt;<a href="qtoolbox-h.html">qtoolbox.h</a>&gt;</tt>
<p>Inherits <a href="qframe.html">QFrame</a>.
<p><a href="qtoolbox-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<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>
<li class=fn>int <a href="#addItem-2"><b>addItem</b></a> ( QWidget&nbsp;*&nbsp;w, const&nbsp;QString&nbsp;&amp;&nbsp;label )</li>
<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>
<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>
<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>
<li class=fn>int <a href="#removeItem"><b>removeItem</b></a> ( QWidget&nbsp;*&nbsp;item )</li>
<li class=fn>void <a href="#setItemEnabled"><b>setItemEnabled</b></a> ( int&nbsp;index, bool&nbsp;enabled )</li>
<li class=fn>bool <a href="#isItemEnabled"><b>isItemEnabled</b></a> ( int&nbsp;index ) const</li>
<li class=fn>void <a href="#setItemLabel"><b>setItemLabel</b></a> ( int&nbsp;index, const&nbsp;QString&nbsp;&amp;&nbsp;label )</li>
<li class=fn>QString <a href="#itemLabel"><b>itemLabel</b></a> ( int&nbsp;index ) const</li>
<li class=fn>void <a href="#setItemIconSet"><b>setItemIconSet</b></a> ( int&nbsp;index, const&nbsp;QIconSet&nbsp;&amp;&nbsp;iconSet )</li>
<li class=fn>QIconSet <a href="#itemIconSet"><b>itemIconSet</b></a> ( int&nbsp;index ) const</li>
<li class=fn>void <a href="#setItemToolTip"><b>setItemToolTip</b></a> ( int&nbsp;index, const&nbsp;QString&nbsp;&amp;&nbsp;toolTip )</li>
<li class=fn>QString <a href="#itemToolTip"><b>itemToolTip</b></a> ( int&nbsp;index ) const</li>
<li class=fn>QWidget * <a href="#currentItem"><b>currentItem</b></a> () const</li>
<li class=fn>void <a href="#setCurrentItem"><b>setCurrentItem</b></a> ( QWidget&nbsp;*&nbsp;item )</li>
<li class=fn>int <a href="#currentIndex"><b>currentIndex</b></a> () const</li>
<li class=fn>QWidget * <a href="#item"><b>item</b></a> ( int&nbsp;index ) const</li>
<li class=fn>int <a href="#indexOf"><b>indexOf</b></a> ( QWidget&nbsp;*&nbsp;item ) const</li>
<li class=fn>int <a href="#count"><b>count</b></a> () const</li>
</ul>
<h2>Public Slots</h2>
<ul>
<li class=fn>void <a href="#setCurrentIndex"><b>setCurrentIndex</b></a> ( int&nbsp;index )</li>
</ul>
<h2>Signals</h2>
<ul>
<li class=fn>void <a href="#currentChanged"><b>currentChanged</b></a> ( int&nbsp;index )</li>
</ul>
<h2>Properties</h2>
<ul>
<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>
<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>
</ul>
<h2>Protected Members</h2>
<ul>
<li class=fn>virtual void <a href="#itemInserted"><b>itemInserted</b></a> ( int&nbsp;index )</li>
<li class=fn>virtual void <a href="#itemRemoved"><b>itemRemoved</b></a> ( int&nbsp;index )</li>
</ul>
<hr><a name="details"></a><h2>Detailed Description</h2>


<p> The QToolBox class provides a column of tabbed widget
items.
<p> 

<p> A toolbox is a widget that displays a column of tabs one above the
other, with the current item displayed below the current tab.
Every tab has an index position within the column of tabs. A tab's
item is a <a href="qwidget.html">QWidget</a>.
<p> Each item has an <a href="#itemLabel">itemLabel</a>(), an optional icon, <a href="#itemIconSet">itemIconSet</a>(), an
optional <a href="#itemToolTip">itemToolTip</a>(), and a <a href="#item">widget</a>. The
item's attributes can be changed with <a href="#setItemLabel">setItemLabel</a>(),
<a href="#setItemIconSet">setItemIconSet</a>() and <a href="#setItemToolTip">setItemToolTip</a>().
<p> Items are added using <a href="#addItem">addItem</a>(), or inserted at particular
positions using <a href="#insertItem">insertItem</a>(). The total number of items is given
by <a href="#count">count</a>(). Items can be deleted with delete, or removed from the
toolbox with <a href="#removeItem">removeItem</a>(). Combining removeItem() and insertItem()
allows to move items to different positions.
<p> The current item widget is returned by <a href="#currentItem">currentItem</a>() and set with
<a href="#setCurrentItem">setCurrentItem</a>(). If you prefer you can work in terms of indexes
using <a href="#currentIndex">currentIndex</a>(), <a href="#setCurrentIndex">setCurrentIndex</a>(), <a href="#indexOf">indexOf</a>() and <a href="#item">item</a>().
<p> The <a href="#currentChanged">currentChanged</a>() signal is emitted when the current item is
changed.
<p> <p>See also <a href="qtabwidget.html">QTabWidget</a> and <a href="advanced.html">Advanced Widgets</a>.

<hr><h2>Member Function Documentation</h2>
<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 )
</h3>
Constructs a toolbox called <em>name</em> with parent <em>parent</em> and flags <em>f</em>.

<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 )
</h3>

Adds the widget <em>item</em> in a new tab at bottom of the toolbox. The
new tab's label is set to <em>label</em>, and the <em>iconSet</em> is
displayed to the left of the <em>label</em>.  Returns the new tab's index.

<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 )
</h3>

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> Adds the widget <em>w</em> in a new tab at bottom of the toolbox. The
new tab's label is set to <em>label</em>. Returns the new tab's index.

<h3 class=fn>int <a name="count"></a>QToolBox::count () const
</h3><p>Returns the number of items contained in the toolbox.
See the <a href="qtoolbox.html#count-prop">"count"</a> property for details.
<h3 class=fn>void <a name="currentChanged"></a>QToolBox::currentChanged ( int&nbsp;index )<tt> [signal]</tt>
</h3>

<p> This signal is emitted when the current item changed. The new
current item's index is passed in <em>index</em>, or -1 if there is no
current item.

<h3 class=fn>int <a name="currentIndex"></a>QToolBox::currentIndex () const
</h3><p>Returns the index of the current item, or -1 if the toolbox is empty.
See the <a href="qtoolbox.html#currentIndex-prop">"currentIndex"</a> property for details.
<h3 class=fn><a href="qwidget.html">QWidget</a>&nbsp;* <a name="currentItem"></a>QToolBox::currentItem () const
</h3>
Returns the toolbox's current item, or 0 if the toolbox is empty.

<h3 class=fn>int <a name="indexOf"></a>QToolBox::indexOf ( <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;item ) const
</h3>
Returns the index of item <em>item</em>, or -1 if the item does not
exist.

<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 )
</h3>
Inserts the widget <em>item</em> at position <em>index</em>, or at the bottom
of the toolbox if <em>index</em> is out of range. The new item's label
is set to <em>label</em>, and the <em>iconSet</em> is displayed to the left of
the <em>label</em>. Returns the new item's index.

<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 )
</h3>

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> Inserts the widget <em>item</em> at position <em>index</em>, or at the bottom
of the toolbox if <em>index</em> is out of range. The new item's label is
set to <em>label</em>. Returns the new item's index.

<h3 class=fn>bool <a name="isItemEnabled"></a>QToolBox::isItemEnabled ( int&nbsp;index ) const
</h3>
Returns TRUE if the item at position <em>index</em> is enabled; otherwise returns FALSE.

<h3 class=fn><a href="qwidget.html">QWidget</a>&nbsp;* <a name="item"></a>QToolBox::item ( int&nbsp;index ) const
</h3>
Returns the item at position <em>index</em>, or 0 if there is no such
item.

<h3 class=fn><a href="qiconset.html">QIconSet</a> <a name="itemIconSet"></a>QToolBox::itemIconSet ( int&nbsp;index ) const
</h3>
Returns the icon of the item at position <em>index</em>, or a null
icon if <em>index</em> is out of range.

<h3 class=fn>void <a name="itemInserted"></a>QToolBox::itemInserted ( int&nbsp;index )<tt> [virtual protected]</tt>
</h3>
This virtual handler is called after a new item was added or
inserted at position <em>index</em>.

<h3 class=fn><a href="qstring.html">QString</a> <a name="itemLabel"></a>QToolBox::itemLabel ( int&nbsp;index ) const
</h3>
Returns the label of the item at position <em>index</em>, or a null string if
<em>index</em> is out of range.

<h3 class=fn>void <a name="itemRemoved"></a>QToolBox::itemRemoved ( int&nbsp;index )<tt> [virtual protected]</tt>
</h3>
This virtual handler is called after an item was removed from
position <em>index</em>.

<h3 class=fn><a href="qstring.html">QString</a> <a name="itemToolTip"></a>QToolBox::itemToolTip ( int&nbsp;index ) const
</h3>
Returns the tooltip of the item at position <em>index</em>, or a null
string if <em>index</em> is out of range.

<h3 class=fn>int <a name="removeItem"></a>QToolBox::removeItem ( <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;item )
</h3>
Removes the widget <em>item</em> from the toolbox. Note that the widget
is <em>not</em> deleted. Returns the removed widget's index, or -1 if
the widget was not in this tool box.

<h3 class=fn>void <a name="setCurrentIndex"></a>QToolBox::setCurrentIndex ( int&nbsp;index )<tt> [slot]</tt>
</h3><p>Sets the index of the current item, or -1 if the toolbox is empty to <em>index</em>.
See the <a href="qtoolbox.html#currentIndex-prop">"currentIndex"</a> property for details.
<h3 class=fn>void <a name="setCurrentItem"></a>QToolBox::setCurrentItem ( <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;item )
</h3>
Sets the current item to be <em>item</em>.

<h3 class=fn>void <a name="setItemEnabled"></a>QToolBox::setItemEnabled ( int&nbsp;index, bool&nbsp;enabled )
</h3>
If <em>enabled</em> is TRUE then the item at position <em>index</em> is enabled; otherwise item
<em>index</em> is disabled.

<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 )
</h3>
Sets the icon of the item at position <em>index</em> to <em>iconSet</em>.

<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 )
</h3>
Sets the label of the item at position <em>index</em> to <em>label</em>.

<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 )
</h3>
Sets the tooltip of the item at position <em>index</em> to <em>toolTip</em>.

<hr><h2>Property Documentation</h2>
<h3 class=fn>int <a name="count-prop"></a>count</h3>
<p>This property holds the number of items contained in the toolbox.
<p>
<p>Get this property's value with <a href="#count">count</a>().
<h3 class=fn>int <a name="currentIndex-prop"></a>currentIndex</h3>
<p>This property holds the index of the current item, or -1 if the toolbox is empty.
<p>Set this property's value with <a href="#setCurrentIndex">setCurrentIndex</a>() and get this property's value with <a href="#currentIndex">currentIndex</a>().
<p><p>See also <a href="#currentItem">currentItem</a>(), <a href="#indexOf">indexOf</a>(), and <a href="#item">item</a>().

<!-- eof -->
<hr><p>
This file is part of the <a href="index.html">Qt toolkit</a>.
Copyright &copy; 1995-2007
<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
<table width=100% cellspacing=0 border=0><tr>
<td>Copyright &copy; 2007
<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
<td align=right><div align=right>Qt 3.3.8</div>
</table></div></address></body>
</html>