summaryrefslogtreecommitdiffstats
path: root/doc/html/ntqlayout.html
blob: 637fef71d6e5312b068d541f25f3e9d95ba4e09e (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
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
<!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/qabstractlayout.cpp:560 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>TQLayout 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>TQLayout Class Reference</h1>

<p>The TQLayout class is the base class of geometry managers.
<a href="#details">More...</a>
<p><tt>#include &lt;<a href="qlayout-h.html">ntqlayout.h</a>&gt;</tt>
<p>Inherits <a href="tqobject.html">TQObject</a> and <a href="qlayoutitem.html">TQLayoutItem</a>.
<p>Inherited by <a href="qgridlayout.html">TQGridLayout</a> and <a href="qboxlayout.html">TQBoxLayout</a>.
<p><a href="qlayout-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li class=fn>enum <a href="#ResizeMode-enum"><b>ResizeMode</b></a> { FreeResize, Minimum, Fixed, Auto }</li>
<li class=fn><a href="#TQLayout"><b>TQLayout</b></a> ( TQWidget&nbsp;*&nbsp;parent, int&nbsp;margin = 0, int&nbsp;spacing = -1, const&nbsp;char&nbsp;*&nbsp;name = 0 )</li>
<li class=fn><a href="#TQLayout-2"><b>TQLayout</b></a> ( TQLayout&nbsp;*&nbsp;parentLayout, int&nbsp;spacing = -1, const&nbsp;char&nbsp;*&nbsp;name = 0 )</li>
<li class=fn><a href="#TQLayout-3"><b>TQLayout</b></a> ( int&nbsp;spacing = -1, const&nbsp;char&nbsp;*&nbsp;name = 0 )</li>
<li class=fn>int <a href="#margin"><b>margin</b></a> () const</li>
<li class=fn>int <a href="#spacing"><b>spacing</b></a> () const</li>
<li class=fn>virtual void <a href="#setMargin"><b>setMargin</b></a> ( int )</li>
<li class=fn>virtual void <a href="#setSpacing"><b>setSpacing</b></a> ( int )</li>
<li class=fn>void <a href="#setResizeMode"><b>setResizeMode</b></a> ( ResizeMode )</li>
<li class=fn>ResizeMode <a href="#resizeMode"><b>resizeMode</b></a> () const</li>
<li class=fn>virtual void <a href="#setMenuBar"><b>setMenuBar</b></a> ( TQMenuBar&nbsp;*&nbsp;w )</li>
<li class=fn>TQMenuBar * <a href="#menuBar"><b>menuBar</b></a> () const</li>
<li class=fn>TQWidget * <a href="#mainWidget"><b>mainWidget</b></a> ()</li>
<li class=fn>bool <a href="#isTopLevel"><b>isTopLevel</b></a> () const</li>
<li class=fn>virtual void <a href="#setAutoAdd"><b>setAutoAdd</b></a> ( bool&nbsp;b )</li>
<li class=fn>bool <a href="#autoAdd"><b>autoAdd</b></a> () const</li>
<li class=fn>virtual void <a href="#invalidate"><b>invalidate</b></a> ()</li>
<li class=fn>bool <a href="#activate"><b>activate</b></a> ()</li>
<li class=fn>void <a href="#add"><b>add</b></a> ( TQWidget&nbsp;*&nbsp;w )</li>
<li class=fn>virtual void <a href="#addItem"><b>addItem</b></a> ( TQLayoutItem&nbsp;*&nbsp;item ) = 0</li>
<li class=fn>void <a href="#remove"><b>remove</b></a> ( TQWidget&nbsp;*&nbsp;widget )</li>
<li class=fn>void <a href="#removeItem"><b>removeItem</b></a> ( TQLayoutItem&nbsp;*&nbsp;item )</li>
<li class=fn>virtual TQSizePolicy::ExpandData <a href="#expanding"><b>expanding</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 void <a href="#setGeometry"><b>setGeometry</b></a> ( const&nbsp;TQRect&nbsp;&amp;&nbsp;r ) = 0</li>
<li class=fn>virtual TQLayoutIterator <a href="#iterator"><b>iterator</b></a> () = 0</li>
<li class=fn>virtual bool <a href="#isEmpty"><b>isEmpty</b></a> () const</li>
<li class=fn>bool <a href="#supportsMargin"><b>supportsMargin</b></a> () const</li>
<li class=fn>void <a href="#setEnabled"><b>setEnabled</b></a> ( bool&nbsp;enable )</li>
<li class=fn>bool <a href="#isEnabled"><b>isEnabled</b></a> () const</li>
</ul>
<h2>Properties</h2>
<ul>
<li class=fn>int <a href="#margin-prop"><b>margin</b></a>&nbsp;- the width of the outside border of the layout</li>
<li class=fn>ResizeMode <a href="#resizeMode-prop"><b>resizeMode</b></a>&nbsp;- the resize mode of the layout</li>
<li class=fn>int <a href="#spacing-prop"><b>spacing</b></a>&nbsp;- the spacing between widgets inside the layout</li>
</ul>
<h2>Protected Members</h2>
<ul>
<li class=fn>void <a href="#addChildLayout"><b>addChildLayout</b></a> ( TQLayout&nbsp;*&nbsp;l )</li>
<li class=fn>void <a href="#deleteAllItems"><b>deleteAllItems</b></a> ()</li>
<li class=fn>void <a href="#setSupportsMargin"><b>setSupportsMargin</b></a> ( bool&nbsp;b )</li>
<li class=fn>TQRect <a href="#alignmentRect"><b>alignmentRect</b></a> ( const&nbsp;TQRect&nbsp;&amp;&nbsp;r ) const</li>
</ul>
<hr><a name="details"></a><h2>Detailed Description</h2>


The TQLayout class is the base class of geometry managers.
<p> 

<p> This is an abstract base class inherited by the concrete classes,
<a href="qboxlayout.html">TQBoxLayout</a> and <a href="qgridlayout.html">TQGridLayout</a>.
<p> For users of TQLayout subclasses or of <a href="ntqmainwindow.html">TQMainWindow</a> there is seldom
any need to use the basic functions provided by TQLayout, such as
<a href="#setResizeMode">setResizeMode</a>() or <a href="#setMenuBar">setMenuBar</a>(). See the <a href="layout.html">layout
    overview page</a> for more information.
<p> To make your own layout manager, subclass <a href="qglayoutiterator.html">TQGLayoutIterator</a> and
implement the functions <a href="#addItem">addItem</a>(), <a href="qlayoutitem.html#sizeHint">sizeHint</a>(), <a href="#setGeometry">setGeometry</a>(), and
<a href="#iterator">iterator</a>(). You should also implement <a href="#minimumSize">minimumSize</a>() to ensure your
layout isn't resized to zero size if there is too little space. To
support children whose heights depend on their widths, implement
<a href="qlayoutitem.html#hasHeightForWidth">hasHeightForWidth</a>() and <a href="qlayoutitem.html#heightForWidth">heightForWidth</a>(). See the <a href="customlayout.html">custom layout page</a> for an in-depth
description.
<p> Geometry management stops when the layout manager is deleted.
<p>See also <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="ResizeMode-enum"></a>TQLayout::ResizeMode</h3>

<p> The possible values are:
<ul>
<li><tt>TQLayout::Auto</tt> - If the main widget is a top-level widget with no
height-for-width (<a href="qlayoutitem.html#hasHeightForWidth">hasHeightForWidth</a>()), this is
the same as <tt>Minimium</tt>; otherwise, this is the
same as <a href="#ResizeMode-enum">FreeResize</a>.
<li><tt>TQLayout::Fixed</tt> - The main widget's size is set to <a href="qlayoutitem.html#sizeHint">sizeHint</a>(); it
cannot be resized at all.
<li><tt>TQLayout::Minimum</tt> - The main widget's minimum size is set to
<a href="#minimumSize">minimumSize</a>(); it cannot be smaller.
<li><tt>TQLayout::FreeResize</tt> - The widget is not constrained.
</ul>
<hr><h2>Member Function Documentation</h2>
<h3 class=fn><a name="TQLayout"></a>TQLayout::TQLayout ( <a href="tqwidget.html">TQWidget</a>&nbsp;*&nbsp;parent, int&nbsp;margin = 0, int&nbsp;spacing = -1, const&nbsp;char&nbsp;*&nbsp;name = 0 )
</h3>
Constructs a new top-level TQLayout called <em>name</em>, with 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 the managed children. The <em>spacing</em> sets the value of
<a href="#spacing">spacing</a>(), which gives the spacing between the managed widgets. If
<em>spacing</em> is -1 (the default), spacing is set to the value of <em>margin</em>.
<p> There can be only one top-level layout for a widget. It is
returned by <a href="tqwidget.html#layout">TQWidget::layout</a>()

<h3 class=fn><a name="TQLayout-2"></a>TQLayout::TQLayout ( <a href="ntqlayout.html">TQLayout</a>&nbsp;*&nbsp;parentLayout, int&nbsp;spacing = -1, const&nbsp;char&nbsp;*&nbsp;name = 0 )
</h3>
Constructs a new child TQLayout called <em>name</em>, and places it
inside <em>parentLayout</em> by using the default placement defined by
<a href="#addItem">addItem</a>().
<p> If <em>spacing</em> is -1, this TQLayout inherits <em>parentLayout</em>'s
<a href="#spacing">spacing</a>(), otherwise the value of <em>spacing</em> is used.

<h3 class=fn><a name="TQLayout-3"></a>TQLayout::TQLayout ( int&nbsp;spacing = -1, const&nbsp;char&nbsp;*&nbsp;name = 0 )
</h3>
Constructs a new child TQLayout called <em>name</em>. If <em>spacing</em> is
-1, this TQLayout inherits its parent's <a href="#spacing">spacing</a>(); otherwise the
value of <em>spacing</em> is used.
<p> This layout has to be inserted into another layout before geometry
management will work.

<h3 class=fn>bool <a name="activate"></a>TQLayout::activate ()
</h3>
Redoes the layout for <a href="#mainWidget">mainWidget</a>(). You should generally not need
to call this because it is automatically called at the most
appropriate times.
<p> However, if you set up a TQLayout for a visible widget without
resizing that widget, you will need to call this function in order
to lay it out.
<p> <p>See also <a href="tqwidget.html#updateGeometry">TQWidget::updateGeometry</a>().

<p>Examples: <a href="layout-example.html#x538">layout/layout.cpp</a>, <a href="popup-example.html#x1609">popup/popup.cpp</a>, <a href="scrollview-example.html#x630">scrollview/scrollview.cpp</a>, and <a href="sql.html#x2222">sql/overview/form1/main.cpp</a>.
<h3 class=fn>void <a name="add"></a>TQLayout::add ( <a href="tqwidget.html">TQWidget</a>&nbsp;*&nbsp;w )
</h3>

<p> Adds widget <em>w</em> to this layout in a manner specific to the
layout. This function uses <a href="#addItem">addItem</a>().

<p>Examples: <a href="customlayout-example.html#x1489">customlayout/border.cpp</a> and <a href="customlayout-example.html#x1536">customlayout/main.cpp</a>.
<h3 class=fn>void <a name="addChildLayout"></a>TQLayout::addChildLayout ( <a href="ntqlayout.html">TQLayout</a>&nbsp;*&nbsp;l )<tt> [protected]</tt>
</h3>
This function is called from addLayout() functions in subclasses
to add layout <em>l</em> as a sub-layout.

<h3 class=fn>void <a name="addItem"></a>TQLayout::addItem ( <a href="qlayoutitem.html">TQLayoutItem</a>&nbsp;*&nbsp;item )<tt> [pure virtual]</tt>
</h3>

<p> Implemented in subclasses to add an <em>item</em>. How it is added is
specific to each subclass.
<p> The ownership of <em>item</em> is transferred to the layout, and it's
the layout's responsibility to delete it.

<p>Examples: <a href="customlayout-example.html#x1490">customlayout/border.cpp</a>, <a href="customlayout-example.html#x1511">customlayout/card.cpp</a>, and <a href="customlayout-example.html#x1467">customlayout/flow.cpp</a>.
<p>Reimplemented in <a href="qgridlayout.html#addItem-2">TQGridLayout</a> and <a href="qboxlayout.html#addItem">TQBoxLayout</a>.
<h3 class=fn><a href="ntqrect.html">TQRect</a> <a name="alignmentRect"></a>TQLayout::alignmentRect ( const&nbsp;<a href="ntqrect.html">TQRect</a>&nbsp;&amp;&nbsp;r ) const<tt> [protected]</tt>
</h3>
Returns the rectangle that should be covered when the geometry of
this layout is set to <em>r</em>, provided that this layout supports
<a href="qlayoutitem.html#setAlignment">setAlignment</a>().
<p> The result is derived from <a href="qlayoutitem.html#sizeHint">sizeHint</a>() and <a href="#expanding">expanding</a>(). It is never
larger than <em>r</em>.

<h3 class=fn>bool <a name="autoAdd"></a>TQLayout::autoAdd () const
</h3>

<p> Returns TRUE if this layout automatically grabs all new
<a href="#mainWidget">mainWidget</a>()'s new children and adds them as defined by <a href="#addItem">addItem</a>();
otherwise returns FALSE. This has effect only for top-level
layouts, i.e. layouts that are direct children of their
mainWidget().
<p> <a href="#autoAdd">autoAdd</a>() is disabled by default.
<p> Note that a top-level layout is not necessarily associated with
the top-level widget.
<p> <p>See also <a href="#setAutoAdd">setAutoAdd</a>().

<h3 class=fn>void <a name="deleteAllItems"></a>TQLayout::deleteAllItems ()<tt> [protected]</tt>
</h3>
Removes and deletes all items in this layout.

<h3 class=fn><a href="ntqsizepolicy.html#ExpandData-enum">TQSizePolicy::ExpandData</a> <a name="expanding"></a>TQLayout::expanding () const<tt> [virtual]</tt>
</h3>
Returns whether this layout can make use of more space than
<a href="qlayoutitem.html#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> The default implementation returns <tt>BothDirections</tt>.

<p>Examples: <a href="customlayout-example.html#x1491">customlayout/border.cpp</a> and <a href="customlayout-example.html#x1468">customlayout/flow.cpp</a>.
<p>Reimplemented from <a href="qlayoutitem.html#expanding">TQLayoutItem</a>.
<p>Reimplemented in <a href="qgridlayout.html#expanding">TQGridLayout</a> and <a href="qboxlayout.html#expanding">TQBoxLayout</a>.
<h3 class=fn>void <a name="invalidate"></a>TQLayout::invalidate ()<tt> [virtual]</tt>
</h3>
Invalidates cached information. Reimplementations must call this.

<p>Reimplemented from <a href="qlayoutitem.html#invalidate">TQLayoutItem</a>.
<p>Reimplemented in <a href="qgridlayout.html#invalidate">TQGridLayout</a> and <a href="qboxlayout.html#invalidate">TQBoxLayout</a>.
<h3 class=fn>bool <a name="isEmpty"></a>TQLayout::isEmpty () const<tt> [virtual]</tt>
</h3>
Returns TRUE if this layout is empty. The default implementation
returns FALSE.

<p>Reimplemented from <a href="qlayoutitem.html#isEmpty">TQLayoutItem</a>.
<h3 class=fn>bool <a name="isEnabled"></a>TQLayout::isEnabled () const
</h3>
Returns TRUE if the layout is enabled; otherwise returns FALSE.
<p> <p>See also <a href="#setEnabled">setEnabled</a>().

<h3 class=fn>bool <a name="isTopLevel"></a>TQLayout::isTopLevel () const
</h3>

<p> Returns TRUE if this layout is a top-level layout, i.e. not a
child of another layout; otherwise returns FALSE.

<h3 class=fn><a href="qlayoutiterator.html">TQLayoutIterator</a> <a name="iterator"></a>TQLayout::iterator ()<tt> [pure virtual]</tt>
</h3>

<p> Implemented in subclasses to return an iterator that iterates over
this layout's children.
<p> A typical implementation will be:
<pre>
        TQLayoutIterator MyLayout::iterator()
        {
            <a href="qglayoutiterator.html">TQGLayoutIterator</a> *i = new MyLayoutIterator( internal_data );
            return TQLayoutIterator( i );
        }
    </pre>
 
where MyLayoutIterator is a subclass of <a href="qglayoutiterator.html">TQGLayoutIterator</a>.

<p>Examples: <a href="customlayout-example.html#x1492">customlayout/border.cpp</a>, <a href="customlayout-example.html#x1512">customlayout/card.cpp</a>, and <a href="customlayout-example.html#x1469">customlayout/flow.cpp</a>.
<p>Reimplemented from <a href="qlayoutitem.html#iterator">TQLayoutItem</a>.
<h3 class=fn><a href="tqwidget.html">TQWidget</a>&nbsp;* <a name="mainWidget"></a>TQLayout::mainWidget ()
</h3>
Returns the main widget (parent widget) of this layout, or 0 if
this layout is a sub-layout that is not yet inserted.

<h3 class=fn>int <a name="margin"></a>TQLayout::margin () const
</h3><p>Returns the width of the outside border of the layout.
See the <a href="ntqlayout.html#margin-prop">"margin"</a> property for details.
<h3 class=fn><a href="ntqsize.html">TQSize</a> <a name="maximumSize"></a>TQLayout::maximumSize () const<tt> [virtual]</tt>
</h3>
Returns the maximum size of this layout. This is the largest size
that the layout can have while still respecting the
specifications. Does not include what's needed by <a href="#margin">margin</a>() or
<a href="#menuBar">menuBar</a>().
<p> The default implementation allows unlimited resizing.

<p>Reimplemented from <a href="qlayoutitem.html#maximumSize">TQLayoutItem</a>.
<p>Reimplemented in <a href="qgridlayout.html#maximumSize">TQGridLayout</a> and <a href="qboxlayout.html#maximumSize">TQBoxLayout</a>.
<h3 class=fn><a href="ntqmenubar.html">TQMenuBar</a>&nbsp;* <a name="menuBar"></a>TQLayout::menuBar () const
</h3>

<p> Returns the menu bar set for this layout, or 0 if no menu bar is
set.

<h3 class=fn><a href="ntqsize.html">TQSize</a> <a name="minimumSize"></a>TQLayout::minimumSize () const<tt> [virtual]</tt>
</h3>
Returns the minimum size of this layout. This is the smallest size
that the layout can have while still respecting the
specifications. Does not include what's needed by <a href="#margin">margin</a>() or
<a href="#menuBar">menuBar</a>().
<p> The default implementation allows unlimited resizing.

<p>Examples: <a href="customlayout-example.html#x1493">customlayout/border.cpp</a>, <a href="customlayout-example.html#x1513">customlayout/card.cpp</a>, and <a href="customlayout-example.html#x1470">customlayout/flow.cpp</a>.
<p>Reimplemented from <a href="qlayoutitem.html#minimumSize">TQLayoutItem</a>.
<p>Reimplemented in <a href="qgridlayout.html#minimumSize">TQGridLayout</a> and <a href="qboxlayout.html#minimumSize">TQBoxLayout</a>.
<h3 class=fn>void <a name="remove"></a>TQLayout::remove ( <a href="tqwidget.html">TQWidget</a>&nbsp;*&nbsp;widget )
</h3>
Removes the widget <em>widget</em> from the layout. After this call, it
is the caller's responsibility to give the widget a reasonable
geometry or to put the widget back into a layout.
<p> <p>See also <a href="#removeItem">removeItem</a>(), <a href="tqwidget.html#geometry-prop">TQWidget::geometry</a>, and <a href="#add">add</a>().

<h3 class=fn>void <a name="removeItem"></a>TQLayout::removeItem ( <a href="qlayoutitem.html">TQLayoutItem</a>&nbsp;*&nbsp;item )
</h3>
Removes the layout item <em>item</em> from the layout. It is the
caller's responsibility to delete the item.
<p> Notice that <em>item</em> can be a layout (since TQLayout inherits
<a href="qlayoutitem.html">TQLayoutItem</a>).
<p> <p>See also <a href="#remove">remove</a>() and <a href="#addItem">addItem</a>().

<h3 class=fn><a href="ntqlayout.html#ResizeMode-enum">ResizeMode</a> <a name="resizeMode"></a>TQLayout::resizeMode () const
</h3><p>Returns the resize mode of the layout.
See the <a href="ntqlayout.html#resizeMode-prop">"resizeMode"</a> property for details.
<h3 class=fn>void <a name="setAutoAdd"></a>TQLayout::setAutoAdd ( bool&nbsp;b )<tt> [virtual]</tt>
</h3>
If <em>b</em> is TRUE, auto-add is enabled; otherwise auto-add is
disabled.
<p> <b>Warning:</b> If auto-add is enabled, you cannot set stretch factors
on the child widgets until the widgets are actually inserted in
the layout (after control returned to the event loop). We
therefore recommend that you avoid the auto-add feature in new
programs.
<p> <p>See also <a href="#autoAdd">autoAdd</a>().

<p>Examples: <a href="i18n-example.html#x1938">i18n/main.cpp</a>.
<h3 class=fn>void <a name="setEnabled"></a>TQLayout::setEnabled ( bool&nbsp;enable )
</h3>
Enables this layout if <em>enable</em> is TRUE, otherwise disables it.
<p> An enabled layout adjusts dynamically to changes; a disabled
layout acts as if it did not exist.
<p> By default all layouts are enabled.
<p> <p>See also <a href="#isEnabled">isEnabled</a>().

<h3 class=fn>void <a name="setGeometry"></a>TQLayout::setGeometry ( const&nbsp;<a href="ntqrect.html">TQRect</a>&nbsp;&amp;&nbsp;r )<tt> [pure virtual]</tt>
</h3>
This function is reimplemented in subclasses to perform layout.
<p> The default implementation maintains the <a href="qlayoutitem.html#geometry">geometry</a>() information
given by rect <em>r</em>. Reimplementors must call this function.

<p>Examples: <a href="customlayout-example.html#x1494">customlayout/border.cpp</a>, <a href="customlayout-example.html#x1514">customlayout/card.cpp</a>, and <a href="customlayout-example.html#x1471">customlayout/flow.cpp</a>.
<p>Reimplemented from <a href="qlayoutitem.html#setGeometry">TQLayoutItem</a>.
<p>Reimplemented in <a href="qgridlayout.html#setGeometry">TQGridLayout</a> and <a href="qboxlayout.html#setGeometry">TQBoxLayout</a>.
<h3 class=fn>void <a name="setMargin"></a>TQLayout::setMargin ( int )<tt> [virtual]</tt>
</h3><p>Sets the width of the outside border of the layout.
See the <a href="ntqlayout.html#margin-prop">"margin"</a> property for details.
<h3 class=fn>void <a name="setMenuBar"></a>TQLayout::setMenuBar ( <a href="ntqmenubar.html">TQMenuBar</a>&nbsp;*&nbsp;w )<tt> [virtual]</tt>
</h3>
Makes the geometry manager take account of the menu bar <em>w</em>. All
child widgets are placed below the bottom edge of the menu bar.
<p> A menu bar does its own geometry management: never do addWidget()
on a <a href="ntqmenubar.html">TQMenuBar</a>.

<p>Examples: <a href="layout-example.html#x539">layout/layout.cpp</a> and <a href="scrollview-example.html#x631">scrollview/scrollview.cpp</a>.
<h3 class=fn>void <a name="setResizeMode"></a>TQLayout::setResizeMode ( <a href="ntqlayout.html#ResizeMode-enum">ResizeMode</a> )
</h3><p>Sets the resize mode of the layout.
See the <a href="ntqlayout.html#resizeMode-prop">"resizeMode"</a> property for details.
<h3 class=fn>void <a name="setSpacing"></a>TQLayout::setSpacing ( int )<tt> [virtual]</tt>
</h3><p>Sets the spacing between widgets inside the layout.
See the <a href="ntqlayout.html#spacing-prop">"spacing"</a> property for details.
<h3 class=fn>void <a name="setSupportsMargin"></a>TQLayout::setSupportsMargin ( bool&nbsp;b )<tt> [protected]</tt>
</h3>
Sets the value returned by <a href="#supportsMargin">supportsMargin</a>(). If <em>b</em> is TRUE,
<a href="#margin">margin</a>() handling is implemented by the subclass. If <em>b</em> is
FALSE (the default), TQLayout will add margin() around top-level
layouts.
<p> If <em>b</em> is TRUE, margin handling needs to be implemented in
<a href="#setGeometry">setGeometry</a>(), <a href="#maximumSize">maximumSize</a>(), <a href="#minimumSize">minimumSize</a>(), <a href="qlayoutitem.html#sizeHint">sizeHint</a>() and
<a href="qlayoutitem.html#heightForWidth">heightForWidth</a>().
<p> <p>See also <a href="#supportsMargin">supportsMargin</a>().

<h3 class=fn>int <a name="spacing"></a>TQLayout::spacing () const
</h3><p>Returns the spacing between widgets inside the layout.
See the <a href="ntqlayout.html#spacing-prop">"spacing"</a> property for details.
<h3 class=fn>bool <a name="supportsMargin"></a>TQLayout::supportsMargin () const
</h3>

<p> Returns TRUE if this layout supports <a href="#margin-prop">TQLayout::margin</a> on
non-top-level layouts; otherwise returns FALSE.
<p> <p>See also <a href="#margin-prop">margin</a>.

<hr><h2>Property Documentation</h2>
<h3 class=fn>int <a name="margin-prop"></a>margin</h3>
<p>This property holds the width of the outside border of the layout.
<p>For some layout classes this property has an effect only on
top-level layouts; <a href="qboxlayout.html">TQBoxLayout</a> and <a href="qgridlayout.html">TQGridLayout</a> support margins for
child layouts. The default value is 0.
<p> <p>See also <a href="#spacing-prop">spacing</a>.

<p>Set this property's value with <a href="#setMargin">setMargin</a>() and get this property's value with <a href="#margin">margin</a>().
<h3 class=fn><a href="ntqlayout.html#ResizeMode-enum">ResizeMode</a> <a name="resizeMode-prop"></a>resizeMode</h3>
<p>This property holds the resize mode of the layout.
<p>The default mode is <a href="#ResizeMode-enum">Auto</a>.
<p> <p>See also <a href="#ResizeMode-enum">TQLayout::ResizeMode</a>.

<p>Set this property's value with <a href="#setResizeMode">setResizeMode</a>() and get this property's value with <a href="#resizeMode">resizeMode</a>().
<h3 class=fn>int <a name="spacing-prop"></a>spacing</h3>
<p>This property holds the spacing between widgets inside the layout.
<p>The default value is -1, which signifies that the layout's spacing
should not override the widget's spacing.
<p> <p>See also <a href="#margin-prop">margin</a>.

<p>Set this property's value with <a href="#setSpacing">setSpacing</a>() and get this property's value with <a href="#spacing">spacing</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>