source: trunk/doc/html/qlayout.html

Last change on this file was 190, checked in by rudi, 14 years ago

reference documentation added

File size: 25.0 KB
Line 
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/kernel/qabstractlayout.cpp:560 -->
3<html>
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
6<title>QLayout Class</title>
7<style type="text/css"><!--
8fn { margin-left: 1cm; text-indent: -1cm; }
9a:link { color: #004faf; text-decoration: none }
10a:visited { color: #672967; text-decoration: none }
11body { 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&nbsp;Classes</font></a>
23 | <a href="mainclasses.html">
24<font color="#004faf">Main&nbsp;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&nbsp;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>QLayout Class Reference</h1>
33
34<p>The QLayout class is the base class of geometry managers.
35<a href="#details">More...</a>
36<p><tt>#include &lt;<a href="qlayout-h.html">qlayout.h</a>&gt;</tt>
37<p>Inherits <a href="qobject.html">QObject</a> and <a href="qlayoutitem.html">QLayoutItem</a>.
38<p>Inherited by <a href="qgridlayout.html">QGridLayout</a> and <a href="qboxlayout.html">QBoxLayout</a>.
39<p><a href="qlayout-members.html">List of all member functions.</a>
40<h2>Public Members</h2>
41<ul>
42<li class=fn>enum <a href="#ResizeMode-enum"><b>ResizeMode</b></a> { FreeResize, Minimum, Fixed, Auto }</li>
43<li class=fn><a href="#QLayout"><b>QLayout</b></a> ( QWidget&nbsp;*&nbsp;parent, int&nbsp;margin = 0, int&nbsp;spacing = -1, const&nbsp;char&nbsp;*&nbsp;name = 0 )</li>
44<li class=fn><a href="#QLayout-2"><b>QLayout</b></a> ( QLayout&nbsp;*&nbsp;parentLayout, int&nbsp;spacing = -1, const&nbsp;char&nbsp;*&nbsp;name = 0 )</li>
45<li class=fn><a href="#QLayout-3"><b>QLayout</b></a> ( int&nbsp;spacing = -1, const&nbsp;char&nbsp;*&nbsp;name = 0 )</li>
46<li class=fn>int <a href="#margin"><b>margin</b></a> () const</li>
47<li class=fn>int <a href="#spacing"><b>spacing</b></a> () const</li>
48<li class=fn>virtual void <a href="#setMargin"><b>setMargin</b></a> ( int )</li>
49<li class=fn>virtual void <a href="#setSpacing"><b>setSpacing</b></a> ( int )</li>
50<li class=fn>void <a href="#setResizeMode"><b>setResizeMode</b></a> ( ResizeMode )</li>
51<li class=fn>ResizeMode <a href="#resizeMode"><b>resizeMode</b></a> () const</li>
52<li class=fn>virtual void <a href="#setMenuBar"><b>setMenuBar</b></a> ( QMenuBar&nbsp;*&nbsp;w )</li>
53<li class=fn>QMenuBar * <a href="#menuBar"><b>menuBar</b></a> () const</li>
54<li class=fn>QWidget * <a href="#mainWidget"><b>mainWidget</b></a> ()</li>
55<li class=fn>bool <a href="#isTopLevel"><b>isTopLevel</b></a> () const</li>
56<li class=fn>virtual void <a href="#setAutoAdd"><b>setAutoAdd</b></a> ( bool&nbsp;b )</li>
57<li class=fn>bool <a href="#autoAdd"><b>autoAdd</b></a> () const</li>
58<li class=fn>virtual void <a href="#invalidate"><b>invalidate</b></a> ()</li>
59<li class=fn>bool <a href="#activate"><b>activate</b></a> ()</li>
60<li class=fn>void <a href="#add"><b>add</b></a> ( QWidget&nbsp;*&nbsp;w )</li>
61<li class=fn>virtual void <a href="#addItem"><b>addItem</b></a> ( QLayoutItem&nbsp;*&nbsp;item ) = 0</li>
62<li class=fn>void <a href="#remove"><b>remove</b></a> ( QWidget&nbsp;*&nbsp;widget )</li>
63<li class=fn>void <a href="#removeItem"><b>removeItem</b></a> ( QLayoutItem&nbsp;*&nbsp;item )</li>
64<li class=fn>virtual QSizePolicy::ExpandData <a href="#expanding"><b>expanding</b></a> () const</li>
65<li class=fn>virtual QSize <a href="#minimumSize"><b>minimumSize</b></a> () const</li>
66<li class=fn>virtual QSize <a href="#maximumSize"><b>maximumSize</b></a> () const</li>
67<li class=fn>virtual void <a href="#setGeometry"><b>setGeometry</b></a> ( const&nbsp;QRect&nbsp;&amp;&nbsp;r ) = 0</li>
68<li class=fn>virtual QLayoutIterator <a href="#iterator"><b>iterator</b></a> () = 0</li>
69<li class=fn>virtual bool <a href="#isEmpty"><b>isEmpty</b></a> () const</li>
70<li class=fn>bool <a href="#supportsMargin"><b>supportsMargin</b></a> () const</li>
71<li class=fn>void <a href="#setEnabled"><b>setEnabled</b></a> ( bool&nbsp;enable )</li>
72<li class=fn>bool <a href="#isEnabled"><b>isEnabled</b></a> () const</li>
73</ul>
74<h2>Properties</h2>
75<ul>
76<li class=fn>int <a href="#margin-prop"><b>margin</b></a>&nbsp;- the width of the outside border of the layout</li>
77<li class=fn>ResizeMode <a href="#resizeMode-prop"><b>resizeMode</b></a>&nbsp;- the resize mode of the layout</li>
78<li class=fn>int <a href="#spacing-prop"><b>spacing</b></a>&nbsp;- the spacing between widgets inside the layout</li>
79</ul>
80<h2>Protected Members</h2>
81<ul>
82<li class=fn>void <a href="#addChildLayout"><b>addChildLayout</b></a> ( QLayout&nbsp;*&nbsp;l )</li>
83<li class=fn>void <a href="#deleteAllItems"><b>deleteAllItems</b></a> ()</li>
84<li class=fn>void <a href="#setSupportsMargin"><b>setSupportsMargin</b></a> ( bool&nbsp;b )</li>
85<li class=fn>QRect <a href="#alignmentRect"><b>alignmentRect</b></a> ( const&nbsp;QRect&nbsp;&amp;&nbsp;r ) const</li>
86</ul>
87<hr><a name="details"></a><h2>Detailed Description</h2>
88
89
90The QLayout class is the base class of geometry managers.
91<p>
92
93<p> This is an abstract base class inherited by the concrete classes,
94<a href="qboxlayout.html">QBoxLayout</a> and <a href="qgridlayout.html">QGridLayout</a>.
95<p> For users of QLayout subclasses or of <a href="qmainwindow.html">QMainWindow</a> there is seldom
96any need to use the basic functions provided by QLayout, such as
97<a href="#setResizeMode">setResizeMode</a>() or <a href="#setMenuBar">setMenuBar</a>(). See the <a href="layout.html">layout
98 overview page</a> for more information.
99<p> To make your own layout manager, subclass <a href="qglayoutiterator.html">QGLayoutIterator</a> and
100implement the functions <a href="#addItem">addItem</a>(), <a href="qlayoutitem.html#sizeHint">sizeHint</a>(), <a href="#setGeometry">setGeometry</a>(), and
101<a href="#iterator">iterator</a>(). You should also implement <a href="#minimumSize">minimumSize</a>() to ensure your
102layout isn't resized to zero size if there is too little space. To
103support children whose heights depend on their widths, implement
104<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
105description.
106<p> Geometry management stops when the layout manager is deleted.
107<p>See also <a href="appearance.html">Widget Appearance and Style</a> and <a href="geomanagement.html">Layout Management</a>.
108
109<hr><h2>Member Type Documentation</h2>
110<h3 class=fn><a name="ResizeMode-enum"></a>QLayout::ResizeMode</h3>
111
112<p> The possible values are:
113<ul>
114<li><tt>QLayout::Auto</tt> - If the main widget is a top-level widget with no
115height-for-width (<a href="qlayoutitem.html#hasHeightForWidth">hasHeightForWidth</a>()), this is
116the same as <tt>Minimium</tt>; otherwise, this is the
117same as <a href="#ResizeMode-enum">FreeResize</a>.
118<li><tt>QLayout::Fixed</tt> - The main widget's size is set to <a href="qlayoutitem.html#sizeHint">sizeHint</a>(); it
119cannot be resized at all.
120<li><tt>QLayout::Minimum</tt> - The main widget's minimum size is set to
121<a href="#minimumSize">minimumSize</a>(); it cannot be smaller.
122<li><tt>QLayout::FreeResize</tt> - The widget is not constrained.
123</ul>
124<hr><h2>Member Function Documentation</h2>
125<h3 class=fn><a name="QLayout"></a>QLayout::QLayout ( <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;parent, int&nbsp;margin = 0, int&nbsp;spacing = -1, const&nbsp;char&nbsp;*&nbsp;name = 0 )
126</h3>
127Constructs a new top-level QLayout called <em>name</em>, with main
128widget <em>parent</em>. <em>parent</em> may not be 0.
129<p> The <em>margin</em> is the number of pixels between the edge of the
130widget and the managed children. The <em>spacing</em> sets the value of
131<a href="#spacing">spacing</a>(), which gives the spacing between the managed widgets. If
132<em>spacing</em> is -1 (the default), spacing is set to the value of <em>margin</em>.
133<p> There can be only one top-level layout for a widget. It is
134returned by <a href="qwidget.html#layout">QWidget::layout</a>()
135
136<h3 class=fn><a name="QLayout-2"></a>QLayout::QLayout ( <a href="qlayout.html">QLayout</a>&nbsp;*&nbsp;parentLayout, int&nbsp;spacing = -1, const&nbsp;char&nbsp;*&nbsp;name = 0 )
137</h3>
138Constructs a new child QLayout called <em>name</em>, and places it
139inside <em>parentLayout</em> by using the default placement defined by
140<a href="#addItem">addItem</a>().
141<p> If <em>spacing</em> is -1, this QLayout inherits <em>parentLayout</em>'s
142<a href="#spacing">spacing</a>(), otherwise the value of <em>spacing</em> is used.
143
144<h3 class=fn><a name="QLayout-3"></a>QLayout::QLayout ( int&nbsp;spacing = -1, const&nbsp;char&nbsp;*&nbsp;name = 0 )
145</h3>
146Constructs a new child QLayout called <em>name</em>. If <em>spacing</em> is
147-1, this QLayout inherits its parent's <a href="#spacing">spacing</a>(); otherwise the
148value of <em>spacing</em> is used.
149<p> This layout has to be inserted into another layout before geometry
150management will work.
151
152<h3 class=fn>bool <a name="activate"></a>QLayout::activate ()
153</h3>
154Redoes the layout for <a href="#mainWidget">mainWidget</a>(). You should generally not need
155to call this because it is automatically called at the most
156appropriate times.
157<p> However, if you set up a QLayout for a visible widget without
158resizing that widget, you will need to call this function in order
159to lay it out.
160<p> <p>See also <a href="qwidget.html#updateGeometry">QWidget::updateGeometry</a>().
161
162<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>.
163<h3 class=fn>void <a name="add"></a>QLayout::add ( <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;w )
164</h3>
165
166<p> Adds widget <em>w</em> to this layout in a manner specific to the
167layout. This function uses <a href="#addItem">addItem</a>().
168
169<p>Examples: <a href="customlayout-example.html#x1489">customlayout/border.cpp</a> and <a href="customlayout-example.html#x1536">customlayout/main.cpp</a>.
170<h3 class=fn>void <a name="addChildLayout"></a>QLayout::addChildLayout ( <a href="qlayout.html">QLayout</a>&nbsp;*&nbsp;l )<tt> [protected]</tt>
171</h3>
172This function is called from addLayout() functions in subclasses
173to add layout <em>l</em> as a sub-layout.
174
175<h3 class=fn>void <a name="addItem"></a>QLayout::addItem ( <a href="qlayoutitem.html">QLayoutItem</a>&nbsp;*&nbsp;item )<tt> [pure virtual]</tt>
176</h3>
177
178<p> Implemented in subclasses to add an <em>item</em>. How it is added is
179specific to each subclass.
180<p> The ownership of <em>item</em> is transferred to the layout, and it's
181the layout's responsibility to delete it.
182
183<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>.
184<p>Reimplemented in <a href="qgridlayout.html#addItem-2">QGridLayout</a> and <a href="qboxlayout.html#addItem">QBoxLayout</a>.
185<h3 class=fn><a href="qrect.html">QRect</a> <a name="alignmentRect"></a>QLayout::alignmentRect ( const&nbsp;<a href="qrect.html">QRect</a>&nbsp;&amp;&nbsp;r ) const<tt> [protected]</tt>
186</h3>
187Returns the rectangle that should be covered when the geometry of
188this layout is set to <em>r</em>, provided that this layout supports
189<a href="qlayoutitem.html#setAlignment">setAlignment</a>().
190<p> The result is derived from <a href="qlayoutitem.html#sizeHint">sizeHint</a>() and <a href="#expanding">expanding</a>(). It is never
191larger than <em>r</em>.
192
193<h3 class=fn>bool <a name="autoAdd"></a>QLayout::autoAdd () const
194</h3>
195
196<p> Returns TRUE if this layout automatically grabs all new
197<a href="#mainWidget">mainWidget</a>()'s new children and adds them as defined by <a href="#addItem">addItem</a>();
198otherwise returns FALSE. This has effect only for top-level
199layouts, i.e. layouts that are direct children of their
200mainWidget().
201<p> <a href="#autoAdd">autoAdd</a>() is disabled by default.
202<p> Note that a top-level layout is not necessarily associated with
203the top-level widget.
204<p> <p>See also <a href="#setAutoAdd">setAutoAdd</a>().
205
206<h3 class=fn>void <a name="deleteAllItems"></a>QLayout::deleteAllItems ()<tt> [protected]</tt>
207</h3>
208Removes and deletes all items in this layout.
209
210<h3 class=fn><a href="qsizepolicy.html#ExpandData-enum">QSizePolicy::ExpandData</a> <a name="expanding"></a>QLayout::expanding () const<tt> [virtual]</tt>
211</h3>
212Returns whether this layout can make use of more space than
213<a href="qlayoutitem.html#sizeHint">sizeHint</a>(). A value of <a href="qt.html#Orientation-enum">Vertical</a> or <a href="qt.html#Orientation-enum">Horizontal</a> means that it wants
214to grow in only one dimension, whereas <tt>BothDirections</tt> means that
215it wants to grow in both dimensions.
216<p> The default implementation returns <tt>BothDirections</tt>.
217
218<p>Examples: <a href="customlayout-example.html#x1491">customlayout/border.cpp</a> and <a href="customlayout-example.html#x1468">customlayout/flow.cpp</a>.
219<p>Reimplemented from <a href="qlayoutitem.html#expanding">QLayoutItem</a>.
220<p>Reimplemented in <a href="qgridlayout.html#expanding">QGridLayout</a> and <a href="qboxlayout.html#expanding">QBoxLayout</a>.
221<h3 class=fn>void <a name="invalidate"></a>QLayout::invalidate ()<tt> [virtual]</tt>
222</h3>
223Invalidates cached information. Reimplementations must call this.
224
225<p>Reimplemented from <a href="qlayoutitem.html#invalidate">QLayoutItem</a>.
226<p>Reimplemented in <a href="qgridlayout.html#invalidate">QGridLayout</a> and <a href="qboxlayout.html#invalidate">QBoxLayout</a>.
227<h3 class=fn>bool <a name="isEmpty"></a>QLayout::isEmpty () const<tt> [virtual]</tt>
228</h3>
229Returns TRUE if this layout is empty. The default implementation
230returns FALSE.
231
232<p>Reimplemented from <a href="qlayoutitem.html#isEmpty">QLayoutItem</a>.
233<h3 class=fn>bool <a name="isEnabled"></a>QLayout::isEnabled () const
234</h3>
235Returns TRUE if the layout is enabled; otherwise returns FALSE.
236<p> <p>See also <a href="#setEnabled">setEnabled</a>().
237
238<h3 class=fn>bool <a name="isTopLevel"></a>QLayout::isTopLevel () const
239</h3>
240
241<p> Returns TRUE if this layout is a top-level layout, i.e. not a
242child of another layout; otherwise returns FALSE.
243
244<h3 class=fn><a href="qlayoutiterator.html">QLayoutIterator</a> <a name="iterator"></a>QLayout::iterator ()<tt> [pure virtual]</tt>
245</h3>
246
247<p> Implemented in subclasses to return an iterator that iterates over
248this layout's children.
249<p> A typical implementation will be:
250<pre>
251 QLayoutIterator MyLayout::iterator()
252 {
253 <a href="qglayoutiterator.html">QGLayoutIterator</a> *i = new MyLayoutIterator( internal_data );
254 return QLayoutIterator( i );
255 }
256 </pre>
257
258where MyLayoutIterator is a subclass of <a href="qglayoutiterator.html">QGLayoutIterator</a>.
259
260<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>.
261<p>Reimplemented from <a href="qlayoutitem.html#iterator">QLayoutItem</a>.
262<h3 class=fn><a href="qwidget.html">QWidget</a>&nbsp;* <a name="mainWidget"></a>QLayout::mainWidget ()
263</h3>
264Returns the main widget (parent widget) of this layout, or 0 if
265this layout is a sub-layout that is not yet inserted.
266
267<h3 class=fn>int <a name="margin"></a>QLayout::margin () const
268</h3><p>Returns the width of the outside border of the layout.
269See the <a href="qlayout.html#margin-prop">"margin"</a> property for details.
270<h3 class=fn><a href="qsize.html">QSize</a> <a name="maximumSize"></a>QLayout::maximumSize () const<tt> [virtual]</tt>
271</h3>
272Returns the maximum size of this layout. This is the largest size
273that the layout can have while still respecting the
274specifications. Does not include what's needed by <a href="#margin">margin</a>() or
275<a href="#menuBar">menuBar</a>().
276<p> The default implementation allows unlimited resizing.
277
278<p>Reimplemented from <a href="qlayoutitem.html#maximumSize">QLayoutItem</a>.
279<p>Reimplemented in <a href="qgridlayout.html#maximumSize">QGridLayout</a> and <a href="qboxlayout.html#maximumSize">QBoxLayout</a>.
280<h3 class=fn><a href="qmenubar.html">QMenuBar</a>&nbsp;* <a name="menuBar"></a>QLayout::menuBar () const
281</h3>
282
283<p> Returns the menu bar set for this layout, or 0 if no menu bar is
284set.
285
286<h3 class=fn><a href="qsize.html">QSize</a> <a name="minimumSize"></a>QLayout::minimumSize () const<tt> [virtual]</tt>
287</h3>
288Returns the minimum size of this layout. This is the smallest size
289that the layout can have while still respecting the
290specifications. Does not include what's needed by <a href="#margin">margin</a>() or
291<a href="#menuBar">menuBar</a>().
292<p> The default implementation allows unlimited resizing.
293
294<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>.
295<p>Reimplemented from <a href="qlayoutitem.html#minimumSize">QLayoutItem</a>.
296<p>Reimplemented in <a href="qgridlayout.html#minimumSize">QGridLayout</a> and <a href="qboxlayout.html#minimumSize">QBoxLayout</a>.
297<h3 class=fn>void <a name="remove"></a>QLayout::remove ( <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;widget )
298</h3>
299Removes the widget <em>widget</em> from the layout. After this call, it
300is the caller's responsibility to give the widget a reasonable
301geometry or to put the widget back into a layout.
302<p> <p>See also <a href="#removeItem">removeItem</a>(), <a href="qwidget.html#geometry-prop">QWidget::geometry</a>, and <a href="#add">add</a>().
303
304<h3 class=fn>void <a name="removeItem"></a>QLayout::removeItem ( <a href="qlayoutitem.html">QLayoutItem</a>&nbsp;*&nbsp;item )
305</h3>
306Removes the layout item <em>item</em> from the layout. It is the
307caller's responsibility to delete the item.
308<p> Notice that <em>item</em> can be a layout (since QLayout inherits
309<a href="qlayoutitem.html">QLayoutItem</a>).
310<p> <p>See also <a href="#remove">remove</a>() and <a href="#addItem">addItem</a>().
311
312<h3 class=fn><a href="qlayout.html#ResizeMode-enum">ResizeMode</a> <a name="resizeMode"></a>QLayout::resizeMode () const
313</h3><p>Returns the resize mode of the layout.
314See the <a href="qlayout.html#resizeMode-prop">"resizeMode"</a> property for details.
315<h3 class=fn>void <a name="setAutoAdd"></a>QLayout::setAutoAdd ( bool&nbsp;b )<tt> [virtual]</tt>
316</h3>
317If <em>b</em> is TRUE, auto-add is enabled; otherwise auto-add is
318disabled.
319<p> <b>Warning:</b> If auto-add is enabled, you cannot set stretch factors
320on the child widgets until the widgets are actually inserted in
321the layout (after control returned to the event loop). We
322therefore recommend that you avoid the auto-add feature in new
323programs.
324<p> <p>See also <a href="#autoAdd">autoAdd</a>().
325
326<p>Examples: <a href="qaxserver-example-hierarchy.html#x2649">hierarchy/objects.cpp</a> and <a href="i18n-example.html#x1938">i18n/main.cpp</a>.
327<h3 class=fn>void <a name="setEnabled"></a>QLayout::setEnabled ( bool&nbsp;enable )
328</h3>
329Enables this layout if <em>enable</em> is TRUE, otherwise disables it.
330<p> An enabled layout adjusts dynamically to changes; a disabled
331layout acts as if it did not exist.
332<p> By default all layouts are enabled.
333<p> <p>See also <a href="#isEnabled">isEnabled</a>().
334
335<h3 class=fn>void <a name="setGeometry"></a>QLayout::setGeometry ( const&nbsp;<a href="qrect.html">QRect</a>&nbsp;&amp;&nbsp;r )<tt> [pure virtual]</tt>
336</h3>
337This function is reimplemented in subclasses to perform layout.
338<p> The default implementation maintains the <a href="qlayoutitem.html#geometry">geometry</a>() information
339given by rect <em>r</em>. Reimplementors must call this function.
340
341<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>.
342<p>Reimplemented from <a href="qlayoutitem.html#setGeometry">QLayoutItem</a>.
343<p>Reimplemented in <a href="qgridlayout.html#setGeometry">QGridLayout</a> and <a href="qboxlayout.html#setGeometry">QBoxLayout</a>.
344<h3 class=fn>void <a name="setMargin"></a>QLayout::setMargin ( int )<tt> [virtual]</tt>
345</h3><p>Sets the width of the outside border of the layout.
346See the <a href="qlayout.html#margin-prop">"margin"</a> property for details.
347<h3 class=fn>void <a name="setMenuBar"></a>QLayout::setMenuBar ( <a href="qmenubar.html">QMenuBar</a>&nbsp;*&nbsp;w )<tt> [virtual]</tt>
348</h3>
349Makes the geometry manager take account of the menu bar <em>w</em>. All
350child widgets are placed below the bottom edge of the menu bar.
351<p> A menu bar does its own geometry management: never do addWidget()
352on a <a href="qmenubar.html">QMenuBar</a>.
353
354<p>Examples: <a href="layout-example.html#x539">layout/layout.cpp</a> and <a href="scrollview-example.html#x631">scrollview/scrollview.cpp</a>.
355<h3 class=fn>void <a name="setResizeMode"></a>QLayout::setResizeMode ( <a href="qlayout.html#ResizeMode-enum">ResizeMode</a> )
356</h3><p>Sets the resize mode of the layout.
357See the <a href="qlayout.html#resizeMode-prop">"resizeMode"</a> property for details.
358<h3 class=fn>void <a name="setSpacing"></a>QLayout::setSpacing ( int )<tt> [virtual]</tt>
359</h3><p>Sets the spacing between widgets inside the layout.
360See the <a href="qlayout.html#spacing-prop">"spacing"</a> property for details.
361<h3 class=fn>void <a name="setSupportsMargin"></a>QLayout::setSupportsMargin ( bool&nbsp;b )<tt> [protected]</tt>
362</h3>
363Sets the value returned by <a href="#supportsMargin">supportsMargin</a>(). If <em>b</em> is TRUE,
364<a href="#margin">margin</a>() handling is implemented by the subclass. If <em>b</em> is
365FALSE (the default), QLayout will add margin() around top-level
366layouts.
367<p> If <em>b</em> is TRUE, margin handling needs to be implemented in
368<a href="#setGeometry">setGeometry</a>(), <a href="#maximumSize">maximumSize</a>(), <a href="#minimumSize">minimumSize</a>(), <a href="qlayoutitem.html#sizeHint">sizeHint</a>() and
369<a href="qlayoutitem.html#heightForWidth">heightForWidth</a>().
370<p> <p>See also <a href="#supportsMargin">supportsMargin</a>().
371
372<h3 class=fn>int <a name="spacing"></a>QLayout::spacing () const
373</h3><p>Returns the spacing between widgets inside the layout.
374See the <a href="qlayout.html#spacing-prop">"spacing"</a> property for details.
375<h3 class=fn>bool <a name="supportsMargin"></a>QLayout::supportsMargin () const
376</h3>
377
378<p> Returns TRUE if this layout supports <a href="#margin-prop">QLayout::margin</a> on
379non-top-level layouts; otherwise returns FALSE.
380<p> <p>See also <a href="#margin-prop">margin</a>.
381
382<hr><h2>Property Documentation</h2>
383<h3 class=fn>int <a name="margin-prop"></a>margin</h3>
384<p>This property holds the width of the outside border of the layout.
385<p>For some layout classes this property has an effect only on
386top-level layouts; <a href="qboxlayout.html">QBoxLayout</a> and <a href="qgridlayout.html">QGridLayout</a> support margins for
387child layouts. The default value is 0.
388<p> <p>See also <a href="#spacing-prop">spacing</a>.
389
390<p>Set this property's value with <a href="#setMargin">setMargin</a>() and get this property's value with <a href="#margin">margin</a>().
391<h3 class=fn><a href="qlayout.html#ResizeMode-enum">ResizeMode</a> <a name="resizeMode-prop"></a>resizeMode</h3>
392<p>This property holds the resize mode of the layout.
393<p>The default mode is <a href="#ResizeMode-enum">Auto</a>.
394<p> <p>See also <a href="#ResizeMode-enum">QLayout::ResizeMode</a>.
395
396<p>Set this property's value with <a href="#setResizeMode">setResizeMode</a>() and get this property's value with <a href="#resizeMode">resizeMode</a>().
397<h3 class=fn>int <a name="spacing-prop"></a>spacing</h3>
398<p>This property holds the spacing between widgets inside the layout.
399<p>The default value is -1, which signifies that the layout's spacing
400should not override the widget's spacing.
401<p> <p>See also <a href="#margin-prop">margin</a>.
402
403<p>Set this property's value with <a href="#setSpacing">setSpacing</a>() and get this property's value with <a href="#spacing">spacing</a>().
404<!-- eof -->
405<hr><p>
406This file is part of the <a href="index.html">Qt toolkit</a>.
407Copyright &copy; 1995-2007
408<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
409<table width=100% cellspacing=0 border=0><tr>
410<td>Copyright &copy; 2007
411<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
412<td align=right><div align=right>Qt 3.3.8</div>
413</table></div></address></body>
414</html>
Note: See TracBrowser for help on using the repository browser.