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/tqtoolbox.cpp:249 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>TQToolBox 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 Classes</font></a>
| <a href="mainclasses.html">
<font color="#004faf">Main Classes</font></a>
| <a href="annotated.html">
<font color="#004faf">Annotated</font></a>
| <a href="groups.html">
<font color="#004faf">Grouped 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>TQToolBox Class Reference</h1>
<p>The TQToolBox class provides a column of tabbed widget
items.
<a href="#details">More...</a>
<p><tt>#include <<a href="tqtoolbox-h.html">tqtoolbox.h</a>></tt>
<p>Inherits <a href="ntqframe.html">TQFrame</a>.
<p><a href="tqtoolbox-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li class=fn><a href="#TQToolBox"><b>TQToolBox</b></a> ( TQWidget * parent = 0, const char * name = 0, WFlags f = 0 )</li>
<li class=fn>int <a href="#addItem-2"><b>addItem</b></a> ( TQWidget * w, const TQString & label )</li>
<li class=fn>int <a href="#addItem"><b>addItem</b></a> ( TQWidget * item, const TQIconSet & iconSet, const TQString & label )</li>
<li class=fn>int <a href="#insertItem-2"><b>insertItem</b></a> ( int index, TQWidget * item, const TQString & label )</li>
<li class=fn>int <a href="#insertItem"><b>insertItem</b></a> ( int index, TQWidget * item, const TQIconSet & iconSet, const TQString & label )</li>
<li class=fn>int <a href="#removeItem"><b>removeItem</b></a> ( TQWidget * item )</li>
<li class=fn>void <a href="#setItemEnabled"><b>setItemEnabled</b></a> ( int index, bool enabled )</li>
<li class=fn>bool <a href="#isItemEnabled"><b>isItemEnabled</b></a> ( int index ) const</li>
<li class=fn>void <a href="#setItemLabel"><b>setItemLabel</b></a> ( int index, const TQString & label )</li>
<li class=fn>TQString <a href="#itemLabel"><b>itemLabel</b></a> ( int index ) const</li>
<li class=fn>void <a href="#setItemIconSet"><b>setItemIconSet</b></a> ( int index, const TQIconSet & iconSet )</li>
<li class=fn>TQIconSet <a href="#itemIconSet"><b>itemIconSet</b></a> ( int index ) const</li>
<li class=fn>void <a href="#setItemToolTip"><b>setItemToolTip</b></a> ( int index, const TQString & toolTip )</li>
<li class=fn>TQString <a href="#itemToolTip"><b>itemToolTip</b></a> ( int index ) const</li>
<li class=fn>TQWidget * <a href="#currentItem"><b>currentItem</b></a> () const</li>
<li class=fn>void <a href="#setCurrentItem"><b>setCurrentItem</b></a> ( TQWidget * item )</li>
<li class=fn>int <a href="#currentIndex"><b>currentIndex</b></a> () const</li>
<li class=fn>TQWidget * <a href="#item"><b>item</b></a> ( int index ) const</li>
<li class=fn>int <a href="#indexOf"><b>indexOf</b></a> ( TQWidget * 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 index )</li>
</ul>
<h2>Signals</h2>
<ul>
<li class=fn>void <a href="#currentChanged"><b>currentChanged</b></a> ( int index )</li>
</ul>
<h2>Properties</h2>
<ul>
<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>
<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>
</ul>
<h2>Protected Members</h2>
<ul>
<li class=fn>virtual void <a href="#itemInserted"><b>itemInserted</b></a> ( int index )</li>
<li class=fn>virtual void <a href="#itemRemoved"><b>itemRemoved</b></a> ( int index )</li>
</ul>
<hr><a name="details"></a><h2>Detailed Description</h2>
<p> The TQToolBox 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="tqwidget.html">TQWidget</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="ntqtabwidget.html">TQTabWidget</a> and <a href="advanced.html">Advanced Widgets</a>.
<hr><h2>Member Function Documentation</h2>
<h3 class=fn><a name="TQToolBox"></a>TQToolBox::TQToolBox ( <a href="tqwidget.html">TQWidget</a> * parent = 0, const char * name = 0, WFlags 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>TQToolBox::addItem ( <a href="tqwidget.html">TQWidget</a> * item, const <a href="tqiconset.html">TQIconSet</a> & iconSet, const <a href="tqstring.html">TQString</a> & 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>TQToolBox::addItem ( <a href="tqwidget.html">TQWidget</a> * w, const <a href="tqstring.html">TQString</a> & 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>TQToolBox::count () const
</h3><p>Returns the number of items contained in the toolbox.
See the <a href="tqtoolbox.html#count-prop">"count"</a> property for details.
<h3 class=fn>void <a name="currentChanged"></a>TQToolBox::currentChanged ( int 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>TQToolBox::currentIndex () const
</h3><p>Returns the index of the current item, or -1 if the toolbox is empty.
See the <a href="tqtoolbox.html#currentIndex-prop">"currentIndex"</a> property for details.
<h3 class=fn><a href="tqwidget.html">TQWidget</a> * <a name="currentItem"></a>TQToolBox::currentItem () const
</h3>
Returns the toolbox's current item, or 0 if the toolbox is empty.
<h3 class=fn>int <a name="indexOf"></a>TQToolBox::indexOf ( <a href="tqwidget.html">TQWidget</a> * 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>TQToolBox::insertItem ( int index, <a href="tqwidget.html">TQWidget</a> * item, const <a href="tqiconset.html">TQIconSet</a> & iconSet, const <a href="tqstring.html">TQString</a> & 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>TQToolBox::insertItem ( int index, <a href="tqwidget.html">TQWidget</a> * item, const <a href="tqstring.html">TQString</a> & 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>TQToolBox::isItemEnabled ( int index ) const
</h3>
Returns TRUE if the item at position <em>index</em> is enabled; otherwise returns FALSE.
<h3 class=fn><a href="tqwidget.html">TQWidget</a> * <a name="item"></a>TQToolBox::item ( int index ) const
</h3>
Returns the item at position <em>index</em>, or 0 if there is no such
item.
<h3 class=fn><a href="tqiconset.html">TQIconSet</a> <a name="itemIconSet"></a>TQToolBox::itemIconSet ( int 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>TQToolBox::itemInserted ( int 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="tqstring.html">TQString</a> <a name="itemLabel"></a>TQToolBox::itemLabel ( int 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>TQToolBox::itemRemoved ( int 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="tqstring.html">TQString</a> <a name="itemToolTip"></a>TQToolBox::itemToolTip ( int 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>TQToolBox::removeItem ( <a href="tqwidget.html">TQWidget</a> * 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>TQToolBox::setCurrentIndex ( int 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="tqtoolbox.html#currentIndex-prop">"currentIndex"</a> property for details.
<h3 class=fn>void <a name="setCurrentItem"></a>TQToolBox::setCurrentItem ( <a href="tqwidget.html">TQWidget</a> * item )
</h3>
Sets the current item to be <em>item</em>.
<h3 class=fn>void <a name="setItemEnabled"></a>TQToolBox::setItemEnabled ( int index, bool 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>TQToolBox::setItemIconSet ( int index, const <a href="tqiconset.html">TQIconSet</a> & 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>TQToolBox::setItemLabel ( int index, const <a href="tqstring.html">TQString</a> & 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>TQToolBox::setItemToolTip ( int index, const <a href="tqstring.html">TQString</a> & 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">TQt toolkit</a>.
Copyright © 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 © 2007
<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
<td align=right><div align=right>TQt 3.3.8</div>
</table></div></address></body>
</html>
|