summaryrefslogtreecommitdiffstats
path: root/doc/html/qboxlayout.html
blob: 117b3a424b5817175936bcf061a241f257783a99 (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
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
<!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/kernel/qlayout.cpp:1616 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>TQBoxLayout 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>TQBoxLayout Class Reference</h1>

<p>The TQBoxLayout class lines up child widgets horizontally or
vertically.
<a href="#details">More...</a>
<p><tt>#include &lt;<a href="qlayout-h.html">ntqlayout.h</a>&gt;</tt>
<p>Inherits <a href="ntqlayout.html">TQLayout</a>.
<p>Inherited by <a href="qhboxlayout.html">TQHBoxLayout</a> and <a href="qvboxlayout.html">TQVBoxLayout</a>.
<p><a href="qboxlayout-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li class=fn>enum <a href="#Direction-enum"><b>Direction</b></a> { LeftToRight, RightToLeft, TopToBottom, BottomToTop, Down = TopToBottom, Up = BottomToTop }</li>
<li class=fn><a href="#TQBoxLayout"><b>TQBoxLayout</b></a> ( TQWidget&nbsp;*&nbsp;parent, Direction&nbsp;d, int&nbsp;margin = 0, int&nbsp;spacing = -1, const&nbsp;char&nbsp;*&nbsp;name = 0 )</li>
<li class=fn><a href="#TQBoxLayout-2"><b>TQBoxLayout</b></a> ( TQLayout&nbsp;*&nbsp;parentLayout, Direction&nbsp;d, int&nbsp;spacing = -1, const&nbsp;char&nbsp;*&nbsp;name = 0 )</li>
<li class=fn><a href="#TQBoxLayout-3"><b>TQBoxLayout</b></a> ( Direction&nbsp;d, int&nbsp;spacing = -1, const&nbsp;char&nbsp;*&nbsp;name = 0 )</li>
<li class=fn><a href="#~TQBoxLayout"><b>~TQBoxLayout</b></a> ()</li>
<li class=fn>virtual void <a href="#addItem"><b>addItem</b></a> ( TQLayoutItem&nbsp;*&nbsp;item )</li>
<li class=fn>Direction <a href="#direction"><b>direction</b></a> () const</li>
<li class=fn>void <a href="#setDirection"><b>setDirection</b></a> ( Direction&nbsp;direction )</li>
<li class=fn>void <a href="#addSpacing"><b>addSpacing</b></a> ( int&nbsp;size )</li>
<li class=fn>void <a href="#addStretch"><b>addStretch</b></a> ( int&nbsp;stretch = 0 )</li>
<li class=fn>void <a href="#addWidget"><b>addWidget</b></a> ( TQWidget&nbsp;*&nbsp;widget, int&nbsp;stretch = 0, int&nbsp;alignment = 0 )</li>
<li class=fn>void <a href="#addLayout"><b>addLayout</b></a> ( TQLayout&nbsp;*&nbsp;layout, int&nbsp;stretch = 0 )</li>
<li class=fn>void <a href="#addStrut"><b>addStrut</b></a> ( int&nbsp;size )</li>
<li class=fn>void <a href="#insertSpacing"><b>insertSpacing</b></a> ( int&nbsp;index, int&nbsp;size )</li>
<li class=fn>void <a href="#insertStretch"><b>insertStretch</b></a> ( int&nbsp;index, int&nbsp;stretch = 0 )</li>
<li class=fn>void <a href="#insertWidget"><b>insertWidget</b></a> ( int&nbsp;index, TQWidget&nbsp;*&nbsp;widget, int&nbsp;stretch = 0, int&nbsp;alignment = 0 )</li>
<li class=fn>void <a href="#insertLayout"><b>insertLayout</b></a> ( int&nbsp;index, TQLayout&nbsp;*&nbsp;layout, int&nbsp;stretch = 0 )</li>
<li class=fn>bool <a href="#setStretchFactor"><b>setStretchFactor</b></a> ( TQWidget&nbsp;*&nbsp;w, int&nbsp;stretch )</li>
<li class=fn>bool <a href="#setStretchFactor-2"><b>setStretchFactor</b></a> ( TQLayout&nbsp;*&nbsp;l, int&nbsp;stretch )</li>
<li class=fn>virtual TQSize <a href="#sizeHint"><b>sizeHint</b></a> () const</li>
<li class=fn>virtual TQSize <a href="#minimumSize"><b>minimumSize</b></a> () const</li>
<li class=fn>virtual TQSize <a href="#maximumSize"><b>maximumSize</b></a> () const</li>
<li class=fn>virtual bool <a href="#hasHeightForWidth"><b>hasHeightForWidth</b></a> () const</li>
<li class=fn>virtual int <a href="#heightForWidth"><b>heightForWidth</b></a> ( int&nbsp;w ) const</li>
<li class=fn>virtual TQSizePolicy::ExpandData <a href="#expanding"><b>expanding</b></a> () const</li>
<li class=fn>virtual void <a href="#invalidate"><b>invalidate</b></a> ()</li>
<li class=fn>virtual void <a href="#setGeometry"><b>setGeometry</b></a> ( const&nbsp;TQRect&nbsp;&amp;&nbsp;r )</li>
<li class=fn>int <a href="#findWidget"><b>findWidget</b></a> ( TQWidget&nbsp;*&nbsp;w )</li>
</ul>
<h2>Protected Members</h2>
<ul>
<li class=fn>void <a href="#insertItem"><b>insertItem</b></a> ( int&nbsp;index, TQLayoutItem&nbsp;*&nbsp;item )</li>
</ul>
<hr><a name="details"></a><h2>Detailed Description</h2>


<p> The TQBoxLayout class lines up child widgets horizontally or
vertically.
<p> 

<p> TQBoxLayout takes the space it gets (from its parent layout or from
the <a href="ntqlayout.html#mainWidget">mainWidget</a>()), divides it up into a row of boxes, and makes
each managed widget fill one box.
<p> <center><img src="qhbox-m.png" alt="Horizontal box with five child widgets"></center> 
<p> If the TQBoxLayout's orientation is <a href="ntqt.html#Orientation-enum">Horizontal</a> the boxes are
placed in a row, with suitable sizes. Each widget (or other box)
will get at least its minimum size and at most its maximum size.
Any excess space is shared according to the stretch factors (more
about that below).
<p> <center><img src="qvbox-m.png" alt="Vertical box with five child widgets"></center> 
<p> If the TQBoxLayout's orientation is <a href="ntqt.html#Orientation-enum">Vertical</a>, the boxes are
placed in a column, again with suitable sizes.
<p> The easiest way to create a TQBoxLayout is to use one of the
convenience classes, e.g. <a href="qhboxlayout.html">TQHBoxLayout</a> (for <a href="ntqt.html#Orientation-enum">Horizontal</a> boxes) or
<a href="qvboxlayout.html">TQVBoxLayout</a> (for <a href="ntqt.html#Orientation-enum">Vertical</a> boxes). You can also use the
TQBoxLayout constructor directly, specifying its direction as <a href="#Direction-enum">LeftToRight</a>, <a href="#Direction-enum">Down</a>, <a href="#Direction-enum">RightToLeft</a> or <a href="#Direction-enum">Up</a>.
<p> If the TQBoxLayout is not the top-level layout (i.e. it is not
managing all of the widget's area and children), you must add it
to its parent layout before you can do anything with it. The
normal way to add a layout is by calling
parentLayout-&gt;addLayout().
<p> Once you have done this, you can add boxes to the TQBoxLayout using
one of four functions:
<p> <ul>
<li> <a href="#addWidget">addWidget</a>() to add a widget to the TQBoxLayout and set the
widget's <a href="layout.html#stretch-factor">stretch factor</a>. (The stretch factor is along the row of
boxes.)
<p> <li> <a href="#addSpacing">addSpacing</a>() to create an empty box; this is one of the
functions you use to create nice and spacious dialogs. See below
for ways to set margins.
<p> <li> <a href="#addStretch">addStretch</a>() to create an empty, stretchable box.
<p> <li> <a href="#addLayout">addLayout</a>() to add a box containing another <a href="ntqlayout.html">TQLayout</a> to the row
and set that layout's stretch factor.
</ul>
<p> Use <a href="#insertWidget">insertWidget</a>(), <a href="#insertSpacing">insertSpacing</a>(), <a href="#insertStretch">insertStretch</a>() or
<a href="#insertLayout">insertLayout</a>() to insert a box at a specified position in the
layout.
<p> TQBoxLayout also includes two margin widths:
<p> <ul>
<li> <a href="ntqlayout.html#setMargin">setMargin</a>() sets the width of the outer border. This is the width
of the reserved space along each of the TQBoxLayout's four sides.
<li> <a href="ntqlayout.html#setSpacing">setSpacing</a>() sets the width between neighboring boxes. (You
can use <a href="#addSpacing">addSpacing</a>() to get more space at a particular spot.)
</ul>
<p> The margin defaults to 0. The spacing defaults to the same as the
margin width for a top-level layout, or to the same as the parent
layout. Both are parameters to the constructor.
<p> To remove a widget from a layout, call <a href="ntqlayout.html#remove">remove</a>(). Calling
<a href="tqwidget.html#hide">TQWidget::hide</a>() on a widget also effectively removes the widget
from the layout until <a href="tqwidget.html#show">TQWidget::show</a>() is called.
<p> You will almost always want to use <a href="qvboxlayout.html">TQVBoxLayout</a> and <a href="qhboxlayout.html">TQHBoxLayout</a>
rather than TQBoxLayout because of their convenient constructors.
<p> <p>See also <a href="tqgrid.html">TQGrid</a>, <a href="layout.html">Layout Overview</a>, <a href="appearance.html">Widget Appearance and Style</a>, and <a href="geomanagement.html">Layout Management</a>.

<hr><h2>Member Type Documentation</h2>
<h3 class=fn><a name="Direction-enum"></a>TQBoxLayout::Direction</h3>

<p> This type is used to determine the direction of a box layout.
<ul>
<li><tt>TQBoxLayout::LeftToRight</tt> - Horizontal, from left to right
<li><tt>TQBoxLayout::RightToLeft</tt> - Horizontal, from right to left
<li><tt>TQBoxLayout::TopToBottom</tt> - Vertical, from top to bottom
<li><tt>TQBoxLayout::Down</tt> - The same as <a href="#Direction-enum">TopToBottom</a>
<li><tt>TQBoxLayout::BottomToTop</tt> - Vertical, from bottom to top
<li><tt>TQBoxLayout::Up</tt> - The same as <a href="#Direction-enum">BottomToTop</a>
</ul>
<hr><h2>Member Function Documentation</h2>
<h3 class=fn><a name="TQBoxLayout"></a>TQBoxLayout::TQBoxLayout ( <a href="tqwidget.html">TQWidget</a>&nbsp;*&nbsp;parent, <a href="qboxlayout.html#Direction-enum">Direction</a>&nbsp;d, int&nbsp;margin = 0, int&nbsp;spacing = -1, const&nbsp;char&nbsp;*&nbsp;name = 0 )
</h3>
Constructs a new TQBoxLayout with direction <em>d</em> and main widget <em>parent</em>. <em>parent</em> may not be 0.
<p> The <em>margin</em> is the number of pixels between the edge of the
widget and its managed children. The <em>spacing</em> is the default
number of pixels between neighboring children. If <em>spacing</em> is -1
the value of <em>margin</em> is used for <em>spacing</em>.
<p> <em>name</em> is the internal object name.
<p> <p>See also <a href="#direction">direction</a>().

<h3 class=fn><a name="TQBoxLayout-2"></a>TQBoxLayout::TQBoxLayout ( <a href="ntqlayout.html">TQLayout</a>&nbsp;*&nbsp;parentLayout, <a href="qboxlayout.html#Direction-enum">Direction</a>&nbsp;d, int&nbsp;spacing = -1, const&nbsp;char&nbsp;*&nbsp;name = 0 )
</h3>
Constructs a new TQBoxLayout called <em>name</em>, with direction <em>d</em>,
and inserts it into <em>parentLayout</em>.
<p> The <em>spacing</em> is the default number of pixels between neighboring
children. If <em>spacing</em> is -1, the layout will inherit its
parent's <a href="ntqlayout.html#spacing">spacing</a>().

<h3 class=fn><a name="TQBoxLayout-3"></a>TQBoxLayout::TQBoxLayout ( <a href="qboxlayout.html#Direction-enum">Direction</a>&nbsp;d, int&nbsp;spacing = -1, const&nbsp;char&nbsp;*&nbsp;name = 0 )
</h3>
Constructs a new TQBoxLayout called <em>name</em>, with direction <em>d</em>.
<p> If <em>spacing</em> is -1, the layout will inherit its parent's
<a href="ntqlayout.html#spacing">spacing</a>(); otherwise <em>spacing</em> is used.
<p> You must insert this box into another layout.

<h3 class=fn><a name="~TQBoxLayout"></a>TQBoxLayout::~TQBoxLayout ()
</h3>
Destroys this box layout.
<p> The layout's widgets aren't destroyed.

<h3 class=fn>void <a name="addItem"></a>TQBoxLayout::addItem ( <a href="qlayoutitem.html">TQLayoutItem</a>&nbsp;*&nbsp;item )<tt> [virtual]</tt>
</h3>
Adds <em>item</em> to the end of this box layout.

<p>Examples: <a href="tutorial2-09.html#x2629">chart/optionsform.cpp</a> and <a href="tutorial2-08.html#x2593">chart/setdataform.cpp</a>.
<p>Reimplemented from <a href="ntqlayout.html#addItem">TQLayout</a>.
<h3 class=fn>void <a name="addLayout"></a>TQBoxLayout::addLayout ( <a href="ntqlayout.html">TQLayout</a>&nbsp;*&nbsp;layout, int&nbsp;stretch = 0 )
</h3>
Adds <em>layout</em> to the end of the box, with serial <a href="layout.html#stretch-factor">stretch factor</a>
<em>stretch</em>.
<p> When a layout is constructed with another layout as its parent,
you don't need to call <a href="#addLayout">addLayout</a>(); the child layout is
automatically added to the parent layout as it is constructed.
<p> <p>See also <a href="#insertLayout">insertLayout</a>(), <a href="ntqlayout.html#setAutoAdd">setAutoAdd</a>(), <a href="#addWidget">addWidget</a>(), and <a href="#addSpacing">addSpacing</a>().

<p>Examples: <a href="tutorial2-09.html#x2630">chart/optionsform.cpp</a>, <a href="tutorial2-08.html#x2594">chart/setdataform.cpp</a>, <a href="simple-font-demo-example.html#x2835">fonts/simple-tqfont-demo/viewer.cpp</a>, <a href="listbox-example.html#x1422">listbox/listbox.cpp</a>, <a href="regexptester-example.html#x2469">regexptester/regexptester.cpp</a>, and <a href="tictac-example.html#x19">tictac/tictac.cpp</a>.
<h3 class=fn>void <a name="addSpacing"></a>TQBoxLayout::addSpacing ( int&nbsp;size )
</h3>
Adds a non-stretchable space with size <em>size</em> to the end of this
box layout. TQBoxLayout provides default margin and spacing. This
function adds additional space.
<p> <p>See also <a href="#insertSpacing">insertSpacing</a>() and <a href="#addStretch">addStretch</a>().

<p>Example: <a href="listbox-example.html#x1423">listbox/listbox.cpp</a>.
<h3 class=fn>void <a name="addStretch"></a>TQBoxLayout::addStretch ( int&nbsp;stretch = 0 )
</h3>
Adds a stretchable space with zero minimum size and <a href="layout.html#stretch-factor">stretch factor</a>
<em>stretch</em> to the end of this box layout.
<p> <p>See also <a href="#addSpacing">addSpacing</a>().

<p>Examples: <a href="layout-example.html#x528">layout/layout.cpp</a>, <a href="listbox-example.html#x1424">listbox/listbox.cpp</a>, <a href="regexptester-example.html#x2470">regexptester/regexptester.cpp</a>, and <a href="tutorial1-13.html#x2410">t13/gamebrd.cpp</a>.
<h3 class=fn>void <a name="addStrut"></a>TQBoxLayout::addStrut ( int&nbsp;size )
</h3>
Limits the perpendicular dimension of the box (e.g. height if the
box is LeftToRight) to a minimum of <em>size</em>. Other constraints may
increase the limit.

<h3 class=fn>void <a name="addWidget"></a>TQBoxLayout::addWidget ( <a href="tqwidget.html">TQWidget</a>&nbsp;*&nbsp;widget, int&nbsp;stretch = 0, int&nbsp;alignment = 0 )
</h3>
Adds <em>widget</em> to the end of this box layout, with a <a href="layout.html#stretch-factor">stretch factor</a> of <em>stretch</em> and alignment <em>alignment</em>.
<p> The stretch factor applies only in the <a href="#direction">direction</a> of the TQBoxLayout, and is relative to the other boxes and
widgets in this TQBoxLayout. Widgets and boxes with higher stretch
factors grow more.
<p> If the stretch factor is 0 and nothing else in the TQBoxLayout has
a stretch factor greater than zero, the space is distributed
according to the TQWidget:sizePolicy() of each widget that's
involved.
<p> Alignment is specified by <em>alignment</em> which is a bitwise OR of <a href="ntqt.html#AlignmentFlags-enum">TQt::AlignmentFlags</a> values. The default alignment is 0, which means
that the widget fills the entire cell.
<p> From TQt 3.0, the <em>alignment</em> parameter is interpreted more
aggressively than in previous versions of TQt. A non-default
alignment now indicates that the widget should not grow to fill
the available space, but should be sized according to <a href="#sizeHint">sizeHint</a>().
<p> <p>See also <a href="#insertWidget">insertWidget</a>(), <a href="ntqlayout.html#setAutoAdd">setAutoAdd</a>(), <a href="#addLayout">addLayout</a>(), and <a href="#addSpacing">addSpacing</a>().

<p>Examples: <a href="tutorial2-09.html#x2631">chart/optionsform.cpp</a>, <a href="checklists-example.html#x423">checklists/checklists.cpp</a>, <a href="layout-example.html#x529">layout/layout.cpp</a>, <a href="lineedits-example.html#x169">lineedits/lineedits.cpp</a>, <a href="listbox-example.html#x1425">listbox/listbox.cpp</a>, <a href="tutorial1-13.html#x2411">t13/gamebrd.cpp</a>, and <a href="tutorial1-13.html#x2401">t13/lcdrange.cpp</a>.
<h3 class=fn><a href="qboxlayout.html#Direction-enum">Direction</a> <a name="direction"></a>TQBoxLayout::direction () const
</h3>

<p> Returns the direction of the box. <a href="#addWidget">addWidget</a>() and <a href="#addSpacing">addSpacing</a>()
work in this direction; the stretch stretches in this direction.
<p> <p>See also <a href="#Direction-enum">TQBoxLayout::Direction</a>, <a href="#addWidget">addWidget</a>(), and <a href="#addSpacing">addSpacing</a>().

<h3 class=fn><a href="tqsizepolicy.html#ExpandData-enum">TQSizePolicy::ExpandData</a> <a name="expanding"></a>TQBoxLayout::expanding () const<tt> [virtual]</tt>
</h3>
Returns whether this layout can make use of more space than
<a href="#sizeHint">sizeHint</a>(). A value of <a href="ntqt.html#Orientation-enum">Vertical</a> or <a href="ntqt.html#Orientation-enum">Horizontal</a> means that it wants
to grow in only one dimension, whereas <tt>BothDirections</tt> means that
it wants to grow in both dimensions.

<p>Reimplemented from <a href="ntqlayout.html#expanding">TQLayout</a>.
<h3 class=fn>int <a name="findWidget"></a>TQBoxLayout::findWidget ( <a href="tqwidget.html">TQWidget</a>&nbsp;*&nbsp;w )
</h3>
Searches for widget <em>w</em> in this layout (not including child
layouts).
<p> Returns the index of <em>w</em>, or -1 if <em>w</em> is not found.

<h3 class=fn>bool <a name="hasHeightForWidth"></a>TQBoxLayout::hasHeightForWidth () const<tt> [virtual]</tt>
</h3>
Returns TRUE if this layout's preferred height depends on its width;
otherwise returns FALSE.

<p>Reimplemented from <a href="qlayoutitem.html#hasHeightForWidth">TQLayoutItem</a>.
<h3 class=fn>int <a name="heightForWidth"></a>TQBoxLayout::heightForWidth ( int&nbsp;w ) const<tt> [virtual]</tt>
</h3>
Returns the layout's preferred height when it is <em>w</em> pixels wide.

<p>Reimplemented from <a href="qlayoutitem.html#heightForWidth">TQLayoutItem</a>.
<h3 class=fn>void <a name="insertItem"></a>TQBoxLayout::insertItem ( int&nbsp;index, <a href="qlayoutitem.html">TQLayoutItem</a>&nbsp;*&nbsp;item )<tt> [protected]</tt>
</h3>
Inserts <em>item</em> into this box layout at position <em>index</em>. If <em>index</em> is negative, the item is added at the end.
<p> <b>Warning:</b> Does not call TQLayout::insertChildLayout() if <em>item</em> is
a <a href="ntqlayout.html">TQLayout</a>.
<p> <p>See also <a href="#addItem">addItem</a>() and <a href="#findWidget">findWidget</a>().

<h3 class=fn>void <a name="insertLayout"></a>TQBoxLayout::insertLayout ( int&nbsp;index, <a href="ntqlayout.html">TQLayout</a>&nbsp;*&nbsp;layout, int&nbsp;stretch = 0 )
</h3>
Inserts <em>layout</em> at position <em>index</em>, with <a href="layout.html#stretch-factor">stretch factor</a> <em>stretch</em>. If <em>index</em> is negative, the layout is added at the end.
<p> <em>layout</em> becomes a child of the box layout.
<p> <p>See also <a href="ntqlayout.html#setAutoAdd">setAutoAdd</a>(), <a href="#insertWidget">insertWidget</a>(), and <a href="#insertSpacing">insertSpacing</a>().

<h3 class=fn>void <a name="insertSpacing"></a>TQBoxLayout::insertSpacing ( int&nbsp;index, int&nbsp;size )
</h3>
Inserts a non-stretchable space at position <em>index</em>, with size <em>size</em>. If <em>index</em> is negative the space is added at the end.
<p> The box layout has default margin and spacing. This function adds
additional space.
<p> <p>See also <a href="#insertStretch">insertStretch</a>().

<h3 class=fn>void <a name="insertStretch"></a>TQBoxLayout::insertStretch ( int&nbsp;index, int&nbsp;stretch = 0 )
</h3>
Inserts a stretchable space at position <em>index</em>, with zero
minimum size and <a href="layout.html#stretch-factor">stretch factor</a> <em>stretch</em>. If <em>index</em> is
negative the space is added at the end.
<p> <p>See also <a href="#insertSpacing">insertSpacing</a>().

<h3 class=fn>void <a name="insertWidget"></a>TQBoxLayout::insertWidget ( int&nbsp;index, <a href="tqwidget.html">TQWidget</a>&nbsp;*&nbsp;widget, int&nbsp;stretch = 0, int&nbsp;alignment = 0 )
</h3>
Inserts <em>widget</em> at position <em>index</em>, with <a href="layout.html#stretch-factor">stretch factor</a> <em>stretch</em> and alignment <em>alignment</em>. If <em>index</em> is negative, the
widget is added at the end.
<p> The stretch factor applies only in the <a href="#direction">direction</a> of the TQBoxLayout, and is relative to the other boxes and
widgets in this TQBoxLayout. Widgets and boxes with higher stretch
factors grow more.
<p> If the stretch factor is 0 and nothing else in the TQBoxLayout has
a stretch factor greater than zero, the space is distributed
according to the TQWidget:sizePolicy() of each widget that's
involved.
<p> Alignment is specified by <em>alignment</em>, which is a bitwise OR of
<a href="ntqt.html#AlignmentFlags-enum">TQt::AlignmentFlags</a> values. The default alignment is 0, which
means that the widget fills the entire cell.
<p> From TQt 3.0, the <em>alignment</em> parameter is interpreted more
aggressively than in previous versions of TQt. A non-default
alignment now indicates that the widget should not grow to fill
the available space, but should be sized according to <a href="#sizeHint">sizeHint</a>().
<p> <p>See also <a href="ntqlayout.html#setAutoAdd">setAutoAdd</a>(), <a href="#insertLayout">insertLayout</a>(), and <a href="#insertSpacing">insertSpacing</a>().

<h3 class=fn>void <a name="invalidate"></a>TQBoxLayout::invalidate ()<tt> [virtual]</tt>
</h3>
Resets cached information.

<p>Reimplemented from <a href="ntqlayout.html#invalidate">TQLayout</a>.
<h3 class=fn><a href="tqsize.html">TQSize</a> <a name="maximumSize"></a>TQBoxLayout::maximumSize () const<tt> [virtual]</tt>
</h3>
Returns the maximum size needed by this box layout.

<p>Reimplemented from <a href="ntqlayout.html#maximumSize">TQLayout</a>.
<h3 class=fn><a href="tqsize.html">TQSize</a> <a name="minimumSize"></a>TQBoxLayout::minimumSize () const<tt> [virtual]</tt>
</h3>
Returns the minimum size needed by this box layout.

<p>Reimplemented from <a href="ntqlayout.html#minimumSize">TQLayout</a>.
<h3 class=fn>void <a name="setDirection"></a>TQBoxLayout::setDirection ( <a href="qboxlayout.html#Direction-enum">Direction</a>&nbsp;direction )
</h3>
Sets the direction of this layout to <em>direction</em>.

<h3 class=fn>void <a name="setGeometry"></a>TQBoxLayout::setGeometry ( const&nbsp;<a href="tqrect.html">TQRect</a>&nbsp;&amp;&nbsp;r )<tt> [virtual]</tt>
</h3>
Resizes managed widgets within the rectangle <em>r</em>.

<p>Reimplemented from <a href="ntqlayout.html#setGeometry">TQLayout</a>.
<h3 class=fn>bool <a name="setStretchFactor"></a>TQBoxLayout::setStretchFactor ( <a href="tqwidget.html">TQWidget</a>&nbsp;*&nbsp;w, int&nbsp;stretch )
</h3>
Sets the <a href="layout.html#stretch-factor">stretch factor</a> for widget <em>w</em> to <em>stretch</em> and returns
TRUE if <em>w</em> is found in this layout (not including child
layouts); otherwise returns FALSE.

<h3 class=fn>bool <a name="setStretchFactor-2"></a>TQBoxLayout::setStretchFactor ( <a href="ntqlayout.html">TQLayout</a>&nbsp;*&nbsp;l, int&nbsp;stretch )
</h3>
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> Sets the <a href="layout.html#stretch-factor">stretch factor</a> for the layout <em>l</em> to <em>stretch</em> and
returns TRUE if <em>l</em> is found in this layout (not including child
layouts); otherwise returns FALSE.

<h3 class=fn><a href="tqsize.html">TQSize</a> <a name="sizeHint"></a>TQBoxLayout::sizeHint () const<tt> [virtual]</tt>
</h3>
Returns the preferred size of this box layout.

<p>Reimplemented from <a href="qlayoutitem.html#sizeHint">TQLayoutItem</a>.
<!-- eof -->
<hr><p>
This file is part of the <a href="index.html">TQt 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>TQt 3.3.8</div>
</table></div></address></body>
</html>