File: qboxlayout.html

package info (click to toggle)
qt4-x11 4%3A4.8.2%2Bdfsg-11
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 701,696 kB
  • sloc: cpp: 2,686,179; ansic: 375,485; python: 25,859; sh: 19,349; xml: 17,091; perl: 14,765; yacc: 5,383; asm: 5,038; makefile: 1,259; lex: 555; ruby: 526; objc: 347; cs: 112; pascal: 112; php: 54; sed: 34
file content (360 lines) | stat: -rw-r--r-- 37,959 bytes parent folder | download
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
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qboxlayout.cpp -->
  <title>Qt 4.8: QBoxLayout Class Reference</title>
  <link rel="stylesheet" type="text/css" href="style/offline.css" />
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="content"> 
    <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
  </div>
  <div class="breadcrumb toolblock">
    <ul>
      <li class="first"><a href="index.html">Home</a></li>
      <!--  Breadcrumbs go here -->
<li><a href="modules.html">Modules</a></li>
<li><a href="qtgui.html">QtGui</a></li>
<li>QBoxLayout</li>
    </ul>
  </div>
</div>
<div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-types">Public Types</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#protected-functions">Protected Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">QBoxLayout Class Reference</h1>
<!-- $$$QBoxLayout-brief -->
<p>The QBoxLayout class lines up child widgets horizontally or vertically. <a href="#details">More...</a></p>
<!-- @@@QBoxLayout -->
<pre class="cpp"> <span class="preprocessor">#include &lt;QBoxLayout&gt;</span></pre><p><b>Inherits: </b><a href="qlayout.html">QLayout</a>.</p>
<p><b>Inherited by: </b><a href="q3hboxlayout.html" class="compat">Q3HBoxLayout</a>, <a href="q3vboxlayout.html" class="compat">Q3VBoxLayout</a>, <a href="qhboxlayout.html">QHBoxLayout</a>, and <a href="qvboxlayout.html">QVBoxLayout</a>.</p>
<ul>
<li><a href="qboxlayout-members.html">List of all members, including inherited members</a></li>
<li><a href="qboxlayout-qt3.html">Qt 3 support members</a></li>
</ul>
<a name="public-types"></a>
<h2>Public Types</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#Direction-enum">Direction</a></b> { LeftToRight, RightToLeft, TopToBottom, BottomToTop }</td></tr>
</table>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#QBoxLayout">QBoxLayout</a></b> ( Direction <i>dir</i>, QWidget * <i>parent</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#dtor.QBoxLayout">~QBoxLayout</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#addLayout">addLayout</a></b> ( QLayout * <i>layout</i>, int <i>stretch</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#addSpacerItem">addSpacerItem</a></b> ( QSpacerItem * <i>spacerItem</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#addSpacing">addSpacing</a></b> ( int <i>size</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#addStretch">addStretch</a></b> ( int <i>stretch</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#addStrut">addStrut</a></b> ( int <i>size</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#addWidget">addWidget</a></b> ( QWidget * <i>widget</i>, int <i>stretch</i> = 0, Qt::Alignment <i>alignment</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Direction </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#direction">direction</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#insertLayout">insertLayout</a></b> ( int <i>index</i>, QLayout * <i>layout</i>, int <i>stretch</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#insertSpacerItem">insertSpacerItem</a></b> ( int <i>index</i>, QSpacerItem * <i>spacerItem</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#insertSpacing">insertSpacing</a></b> ( int <i>index</i>, int <i>size</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#insertStretch">insertStretch</a></b> ( int <i>index</i>, int <i>stretch</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#insertWidget">insertWidget</a></b> ( int <i>index</i>, QWidget * <i>widget</i>, int <i>stretch</i> = 0, Qt::Alignment <i>alignment</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#setDirection">setDirection</a></b> ( Direction <i>direction</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#setSpacing">setSpacing</a></b> ( int <i>spacing</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#setStretch">setStretch</a></b> ( int <i>index</i>, int <i>stretch</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#setStretchFactor">setStretchFactor</a></b> ( QWidget * <i>widget</i>, int <i>stretch</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#setStretchFactor-2">setStretchFactor</a></b> ( QLayout * <i>layout</i>, int <i>stretch</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#spacing">spacing</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#stretch">stretch</a></b> ( int <i>index</i> ) const</td></tr>
</table>
<a name="reimplemented-public-functions"></a>
<h2>Reimplemented Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#addItem">addItem</a></b> ( QLayoutItem * <i>item</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual int </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#count">count</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual Qt::Orientations </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#expandingDirections">expandingDirections</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#hasHeightForWidth">hasHeightForWidth</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual int </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#heightForWidth">heightForWidth</a></b> ( int <i>w</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#invalidate">invalidate</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QLayoutItem * </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#itemAt">itemAt</a></b> ( int <i>index</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QSize </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#maximumSize">maximumSize</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual int </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#minimumHeightForWidth">minimumHeightForWidth</a></b> ( int <i>w</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QSize </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#minimumSize">minimumSize</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#setGeometry">setGeometry</a></b> ( const QRect &amp; <i>r</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QSize </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#sizeHint">sizeHint</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QLayoutItem * </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#takeAt">takeAt</a></b> ( int <i>index</i> )</td></tr>
</table>
<ul>
<li class="fn">35 public functions inherited from <a href="qlayout.html#public-functions">QLayout</a></li>
<li class="fn">29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
<li class="fn">17 public functions inherited from <a href="qlayoutitem.html#public-functions">QLayoutItem</a></li>
</ul>
<a name="protected-functions"></a>
<h2>Protected Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#insertItem">insertItem</a></b> ( int <i>index</i>, QLayoutItem * <i>item</i> )</td></tr>
</table>
<ul>
<li class="fn">4 protected functions inherited from <a href="qlayout.html#protected-functions">QLayout</a></li>
<li class="fn">8 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">2 properties inherited from <a href="qlayout.html#properties">QLayout</a></li>
<li class="fn">1 property inherited from <a href="qobject.html#properties">QObject</a></li>
<li class="fn">1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
<li class="fn">1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
<li class="fn">1 static public member inherited from <a href="qlayout.html#static-public-members">QLayout</a></li>
<li class="fn">7 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
</ul>
<a name="details"></a>
<!-- $$$QBoxLayout-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QBoxLayout class lines up child widgets horizontally or vertically.</p>
<p>QBoxLayout takes the space it gets (from its parent layout or from the <a href="qlayout.html#parentWidget">parentWidget</a>()), divides it up into a row of boxes, and makes each managed widget fill one box.</p>
<p class="centerAlign"><img src="images/qhboxlayout-with-5-children.png" alt="Horizontal box layout with five child widgets" /></p><p>If the QBoxLayout's orientation is <a href="qt.html#Orientation-enum">Qt::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>
<p class="centerAlign"><img src="images/qvboxlayout-with-5-children.png" alt="Vertical box layout with five child widgets" /></p><p>If the QBoxLayout's orientation is <a href="qt.html#Orientation-enum">Qt::Vertical</a>, the boxes are placed in a column, again with suitable sizes.</p>
<p>The easiest way to create a QBoxLayout is to use one of the convenience classes, e.g&#x2e; <a href="qhboxlayout.html">QHBoxLayout</a> (for <a href="qt.html#Orientation-enum">Qt::Horizontal</a> boxes) or <a href="qvboxlayout.html">QVBoxLayout</a> (for <a href="qt.html#Orientation-enum">Qt::Vertical</a> boxes). You can also use the QBoxLayout constructor directly, specifying its direction as <a href="qboxlayout.html#Direction-enum">LeftToRight</a>, <a href="qboxlayout.html#Direction-enum">RightToLeft</a>, <a href="qboxlayout.html#Direction-enum">TopToBottom</a>, or <a href="qboxlayout.html#Direction-enum">BottomToTop</a>.</p>
<p>If the QBoxLayout is not the top-level layout (i.e&#x2e; 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;<a href="qboxlayout.html#addLayout">addLayout</a>().</p>
<p>Once you have done this, you can add boxes to the QBoxLayout using one of four functions:</p>
<ul>
<li><a href="qboxlayout.html#addWidget">addWidget</a>() to add a widget to the QBoxLayout and set the widget's stretch factor. (The stretch factor is along the row of boxes.)</li>
<li><a href="qboxlayout.html#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.</li>
<li><a href="qboxlayout.html#addStretch">addStretch</a>() to create an empty, stretchable box.</li>
<li><a href="qboxlayout.html#addLayout">addLayout</a>() to add a box containing another <a href="qlayout.html">QLayout</a> to the row and set that layout's stretch factor.</li>
</ul>
<p>Use <a href="qboxlayout.html#insertWidget">insertWidget</a>(), <a href="qboxlayout.html#insertSpacing">insertSpacing</a>(), <a href="qboxlayout.html#insertStretch">insertStretch</a>() or <a href="qboxlayout.html#insertLayout">insertLayout</a>() to insert a box at a specified position in the layout.</p>
<p>QBoxLayout also includes two margin widths:</p>
<ul>
<li><a href="qlayout.html#setContentsMargins">setContentsMargins</a>() sets the width of the outer border on each side of the widget. This is the width of the reserved space along each of the QBoxLayout's four sides.</li>
<li><a href="qboxlayout.html#setSpacing">setSpacing</a>() sets the width between neighboring boxes. (You can use <a href="qboxlayout.html#addSpacing">addSpacing</a>() to get more space at a particular spot.)</li>
</ul>
<p>The margin default is provided by the style. The default margin most Qt styles specify is 9 for child widgets and 11 for windows. The spacing defaults to the same as the margin width for a top-level layout, or to the same as the parent layout.</p>
<p>To remove a widget from a layout, call <a href="qlayout.html#removeWidget">removeWidget</a>(). Calling <a href="qwidget.html#hide">QWidget::hide</a>() on a widget also effectively removes the widget from the layout until <a href="qwidget.html#show">QWidget::show</a>() is called.</p>
<p>You will almost always want to use <a href="qvboxlayout.html">QVBoxLayout</a> and <a href="qhboxlayout.html">QHBoxLayout</a> rather than QBoxLayout because of their convenient constructors.</p>
</div>
<p><b>See also </b><a href="qgridlayout.html">QGridLayout</a>, <a href="qstackedlayout.html">QStackedLayout</a>, and <a href="layout.html">Layout Management</a>.</p>
<!-- @@@QBoxLayout -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$Direction$$$LeftToRight$$$RightToLeft$$$TopToBottom$$$BottomToTop$$$Down$$$Up -->
<h3 class="fn"><a name="Direction-enum"></a>enum QBoxLayout::<span class="name">Direction</span></h3>
<p>This type is used to determine the direction of a box layout.</p>
<table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><tt>QBoxLayout::LeftToRight</tt></td><td class="topAlign"><tt>0</tt></td><td class="topAlign">Horizontal from left to right.</td></tr>
<tr><td class="topAlign"><tt>QBoxLayout::RightToLeft</tt></td><td class="topAlign"><tt>1</tt></td><td class="topAlign">Horizontal from right to left.</td></tr>
<tr><td class="topAlign"><tt>QBoxLayout::TopToBottom</tt></td><td class="topAlign"><tt>2</tt></td><td class="topAlign">Vertical from top to bottom.</td></tr>
<tr><td class="topAlign"><tt>QBoxLayout::BottomToTop</tt></td><td class="topAlign"><tt>3</tt></td><td class="topAlign">Vertical from bottom to top.</td></tr>
</table>
<!-- @@@Direction -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QBoxLayout[overload1]$$$QBoxLayoutDirectionQWidget* -->
<h3 class="fn"><a name="QBoxLayout"></a>QBoxLayout::<span class="name">QBoxLayout</span> ( <span class="type"><a href="qboxlayout.html#Direction-enum">Direction</a></span> <i>dir</i>, <span class="type"><a href="qwidget.html">QWidget</a></span> * <i>parent</i> = 0 )</h3>
<p>Constructs a new <a href="qboxlayout.html">QBoxLayout</a> with direction <i>dir</i> and parent widget <i>parent</i>.</p>
<p><b>See also </b><a href="qboxlayout.html#direction">direction</a>().</p>
<!-- @@@QBoxLayout -->
<!-- $$$~QBoxLayout[overload1]$$$~QBoxLayout -->
<h3 class="fn"><a name="dtor.QBoxLayout"></a>QBoxLayout::<span class="name">~QBoxLayout</span> ()</h3>
<p>Destroys this box layout.</p>
<p>The layout's widgets aren't destroyed.</p>
<!-- @@@~QBoxLayout -->
<!-- $$$addItem[overload1]$$$addItemQLayoutItem* -->
<h3 class="fn"><a name="addItem"></a><span class="type">void</span> QBoxLayout::<span class="name">addItem</span> ( <span class="type"><a href="qlayoutitem.html">QLayoutItem</a></span> * <i>item</i> )<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qlayout.html#addItem">QLayout::addItem</a>().</p>
<!-- @@@addItem -->
<!-- $$$addLayout[overload1]$$$addLayoutQLayout*int -->
<h3 class="fn"><a name="addLayout"></a><span class="type">void</span> QBoxLayout::<span class="name">addLayout</span> ( <span class="type"><a href="qlayout.html">QLayout</a></span> * <i>layout</i>, <span class="type">int</span> <i>stretch</i> = 0 )</h3>
<p>Adds <i>layout</i> to the end of the box, with serial stretch factor <i>stretch</i>.</p>
<p><b>See also </b><a href="qboxlayout.html#insertLayout">insertLayout</a>(), <a href="qboxlayout.html#addItem">addItem</a>(), and <a href="qboxlayout.html#addWidget">addWidget</a>().</p>
<!-- @@@addLayout -->
<!-- $$$addSpacerItem[overload1]$$$addSpacerItemQSpacerItem* -->
<h3 class="fn"><a name="addSpacerItem"></a><span class="type">void</span> QBoxLayout::<span class="name">addSpacerItem</span> ( <span class="type"><a href="qspaceritem.html">QSpacerItem</a></span> * <i>spacerItem</i> )</h3>
<p>Adds <i>spacerItem</i> to the end of this box layout.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also </b><a href="qboxlayout.html#addSpacing">addSpacing</a>() and <a href="qboxlayout.html#addStretch">addStretch</a>().</p>
<!-- @@@addSpacerItem -->
<!-- $$$addSpacing[overload1]$$$addSpacingint -->
<h3 class="fn"><a name="addSpacing"></a><span class="type">void</span> QBoxLayout::<span class="name">addSpacing</span> ( <span class="type">int</span> <i>size</i> )</h3>
<p>Adds a non-stretchable space (a <a href="qspaceritem.html">QSpacerItem</a>) with size <i>size</i> to the end of this box layout. <a href="qboxlayout.html">QBoxLayout</a> provides default margin and spacing. This function adds additional space.</p>
<p><b>See also </b><a href="qboxlayout.html#insertSpacing">insertSpacing</a>(), <a href="qboxlayout.html#addItem">addItem</a>(), and <a href="qspaceritem.html">QSpacerItem</a>.</p>
<!-- @@@addSpacing -->
<!-- $$$addStretch[overload1]$$$addStretchint -->
<h3 class="fn"><a name="addStretch"></a><span class="type">void</span> QBoxLayout::<span class="name">addStretch</span> ( <span class="type">int</span> <i>stretch</i> = 0 )</h3>
<p>Adds a stretchable space (a <a href="qspaceritem.html">QSpacerItem</a>) with zero minimum size and stretch factor <i>stretch</i> to the end of this box layout.</p>
<p><b>See also </b><a href="qboxlayout.html#insertStretch">insertStretch</a>(), <a href="qboxlayout.html#addItem">addItem</a>(), and <a href="qspaceritem.html">QSpacerItem</a>.</p>
<!-- @@@addStretch -->
<!-- $$$addStrut[overload1]$$$addStrutint -->
<h3 class="fn"><a name="addStrut"></a><span class="type">void</span> QBoxLayout::<span class="name">addStrut</span> ( <span class="type">int</span> <i>size</i> )</h3>
<p>Limits the perpendicular dimension of the box (e.g&#x2e; height if the box is <a href="qboxlayout.html#Direction-enum">LeftToRight</a>) to a minimum of <i>size</i>. Other constraints may increase the limit.</p>
<p><b>See also </b><a href="qboxlayout.html#addItem">addItem</a>().</p>
<!-- @@@addStrut -->
<!-- $$$addWidget[overload1]$$$addWidgetQWidget*intQt::Alignment -->
<h3 class="fn"><a name="addWidget"></a><span class="type">void</span> QBoxLayout::<span class="name">addWidget</span> ( <span class="type"><a href="qwidget.html">QWidget</a></span> * <i>widget</i>, <span class="type">int</span> <i>stretch</i> = 0, <span class="type"><a href="qt.html#AlignmentFlag-enum">Qt::Alignment</a></span> <i>alignment</i> = 0 )</h3>
<p>Adds <i>widget</i> to the end of this box layout, with a stretch factor of <i>stretch</i> and alignment <i>alignment</i>.</p>
<p>The stretch factor applies only in the <a href="qboxlayout.html#direction">direction</a> of the <a href="qboxlayout.html">QBoxLayout</a>, and is relative to the other boxes and widgets in this <a href="qboxlayout.html">QBoxLayout</a>. Widgets and boxes with higher stretch factors grow more.</p>
<p>If the stretch factor is 0 and nothing else in the <a href="qboxlayout.html">QBoxLayout</a> has a stretch factor greater than zero, the space is distributed according to the <a href="qwidget.html">QWidget</a>:sizePolicy() of each widget that's involved.</p>
<p>The alignment is specified by <i>alignment</i>. The default alignment is 0, which means that the widget fills the entire cell.</p>
<p><b>See also </b><a href="qboxlayout.html#insertWidget">insertWidget</a>(), <a href="qboxlayout.html#addItem">addItem</a>(), <a href="qboxlayout.html#addLayout">addLayout</a>(), <a href="qboxlayout.html#addStretch">addStretch</a>(), <a href="qboxlayout.html#addSpacing">addSpacing</a>(), and <a href="qboxlayout.html#addStrut">addStrut</a>().</p>
<!-- @@@addWidget -->
<!-- $$$count[overload1]$$$count -->
<h3 class="fn"><a name="count"></a><span class="type">int</span> QBoxLayout::<span class="name">count</span> () const<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qlayout.html#count">QLayout::count</a>().</p>
<!-- @@@count -->
<!-- $$$direction[overload1]$$$direction -->
<h3 class="fn"><a name="direction"></a><span class="type"><a href="qboxlayout.html#Direction-enum">Direction</a></span> QBoxLayout::<span class="name">direction</span> () const</h3>
<p>Returns the direction of the box. <a href="qboxlayout.html#addWidget">addWidget</a>() and <a href="qboxlayout.html#addSpacing">addSpacing</a>() work in this direction; the stretch stretches in this direction.</p>
<p><b>See also </b><a href="qboxlayout.html#setDirection">setDirection</a>(), <a href="qboxlayout.html#Direction-enum">QBoxLayout::Direction</a>, <a href="qboxlayout.html#addWidget">addWidget</a>(), and <a href="qboxlayout.html#addSpacing">addSpacing</a>().</p>
<!-- @@@direction -->
<!-- $$$expandingDirections[overload1]$$$expandingDirections -->
<h3 class="fn"><a name="expandingDirections"></a><span class="type"><a href="qt.html#Orientation-enum">Qt::Orientations</a></span> QBoxLayout::<span class="name">expandingDirections</span> () const<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qlayoutitem.html#expandingDirections">QLayoutItem::expandingDirections</a>().</p>
<!-- @@@expandingDirections -->
<!-- $$$hasHeightForWidth[overload1]$$$hasHeightForWidth -->
<h3 class="fn"><a name="hasHeightForWidth"></a><span class="type">bool</span> QBoxLayout::<span class="name">hasHeightForWidth</span> () const<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qlayoutitem.html#hasHeightForWidth">QLayoutItem::hasHeightForWidth</a>().</p>
<!-- @@@hasHeightForWidth -->
<!-- $$$heightForWidth[overload1]$$$heightForWidthint -->
<h3 class="fn"><a name="heightForWidth"></a><span class="type">int</span> QBoxLayout::<span class="name">heightForWidth</span> ( <span class="type">int</span> <i>w</i> ) const<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qlayoutitem.html#heightForWidth">QLayoutItem::heightForWidth</a>().</p>
<!-- @@@heightForWidth -->
<!-- $$$insertItem[overload1]$$$insertItemintQLayoutItem* -->
<h3 class="fn"><a name="insertItem"></a><span class="type">void</span> QBoxLayout::<span class="name">insertItem</span> ( <span class="type">int</span> <i>index</i>, <span class="type"><a href="qlayoutitem.html">QLayoutItem</a></span> * <i>item</i> )<tt> [protected]</tt></h3>
<p>Inserts <i>item</i> into this box layout at position <i>index</i>. If <i>index</i> is negative, the item is added at the end.</p>
<p><b>See also </b><a href="qboxlayout.html#addItem">addItem</a>(), <a href="qboxlayout.html#insertWidget">insertWidget</a>(), <a href="qboxlayout.html#insertLayout">insertLayout</a>(), <a href="qboxlayout.html#insertStretch">insertStretch</a>(), and <a href="qboxlayout.html#insertSpacing">insertSpacing</a>().</p>
<!-- @@@insertItem -->
<!-- $$$insertLayout[overload1]$$$insertLayoutintQLayout*int -->
<h3 class="fn"><a name="insertLayout"></a><span class="type">void</span> QBoxLayout::<span class="name">insertLayout</span> ( <span class="type">int</span> <i>index</i>, <span class="type"><a href="qlayout.html">QLayout</a></span> * <i>layout</i>, <span class="type">int</span> <i>stretch</i> = 0 )</h3>
<p>Inserts <i>layout</i> at position <i>index</i>, with stretch factor <i>stretch</i>. If <i>index</i> is negative, the layout is added at the end.</p>
<p><i>layout</i> becomes a child of the box layout.</p>
<p><b>See also </b><a href="qboxlayout.html#addLayout">addLayout</a>() and <a href="qboxlayout.html#insertItem">insertItem</a>().</p>
<!-- @@@insertLayout -->
<!-- $$$insertSpacerItem[overload1]$$$insertSpacerItemintQSpacerItem* -->
<h3 class="fn"><a name="insertSpacerItem"></a><span class="type">void</span> QBoxLayout::<span class="name">insertSpacerItem</span> ( <span class="type">int</span> <i>index</i>, <span class="type"><a href="qspaceritem.html">QSpacerItem</a></span> * <i>spacerItem</i> )</h3>
<p>Inserts <i>spacerItem</i> at position <i>index</i>, with zero minimum size and stretch factor. If <i>index</i> is negative the space is added at the end.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also </b><a href="qboxlayout.html#addSpacerItem">addSpacerItem</a>(), <a href="qboxlayout.html#insertStretch">insertStretch</a>(), and <a href="qboxlayout.html#insertSpacing">insertSpacing</a>().</p>
<!-- @@@insertSpacerItem -->
<!-- $$$insertSpacing[overload1]$$$insertSpacingintint -->
<h3 class="fn"><a name="insertSpacing"></a><span class="type">void</span> QBoxLayout::<span class="name">insertSpacing</span> ( <span class="type">int</span> <i>index</i>, <span class="type">int</span> <i>size</i> )</h3>
<p>Inserts a non-stretchable space (a <a href="qspaceritem.html">QSpacerItem</a>) at position <i>index</i>, with size <i>size</i>. If <i>index</i> is negative the space is added at the end.</p>
<p>The box layout has default margin and spacing. This function adds additional space.</p>
<p><b>See also </b><a href="qboxlayout.html#addSpacing">addSpacing</a>(), <a href="qboxlayout.html#insertItem">insertItem</a>(), and <a href="qspaceritem.html">QSpacerItem</a>.</p>
<!-- @@@insertSpacing -->
<!-- $$$insertStretch[overload1]$$$insertStretchintint -->
<h3 class="fn"><a name="insertStretch"></a><span class="type">void</span> QBoxLayout::<span class="name">insertStretch</span> ( <span class="type">int</span> <i>index</i>, <span class="type">int</span> <i>stretch</i> = 0 )</h3>
<p>Inserts a stretchable space (a <a href="qspaceritem.html">QSpacerItem</a>) at position <i>index</i>, with zero minimum size and stretch factor <i>stretch</i>. If <i>index</i> is negative the space is added at the end.</p>
<p><b>See also </b><a href="qboxlayout.html#addStretch">addStretch</a>(), <a href="qboxlayout.html#insertItem">insertItem</a>(), and <a href="qspaceritem.html">QSpacerItem</a>.</p>
<!-- @@@insertStretch -->
<!-- $$$insertWidget[overload1]$$$insertWidgetintQWidget*intQt::Alignment -->
<h3 class="fn"><a name="insertWidget"></a><span class="type">void</span> QBoxLayout::<span class="name">insertWidget</span> ( <span class="type">int</span> <i>index</i>, <span class="type"><a href="qwidget.html">QWidget</a></span> * <i>widget</i>, <span class="type">int</span> <i>stretch</i> = 0, <span class="type"><a href="qt.html#AlignmentFlag-enum">Qt::Alignment</a></span> <i>alignment</i> = 0 )</h3>
<p>Inserts <i>widget</i> at position <i>index</i>, with stretch factor <i>stretch</i> and alignment <i>alignment</i>. If <i>index</i> is negative, the widget is added at the end.</p>
<p>The stretch factor applies only in the <a href="qboxlayout.html#direction">direction</a> of the <a href="qboxlayout.html">QBoxLayout</a>, and is relative to the other boxes and widgets in this <a href="qboxlayout.html">QBoxLayout</a>. Widgets and boxes with higher stretch factors grow more.</p>
<p>If the stretch factor is 0 and nothing else in the <a href="qboxlayout.html">QBoxLayout</a> has a stretch factor greater than zero, the space is distributed according to the <a href="qwidget.html">QWidget</a>:sizePolicy() of each widget that's involved.</p>
<p>The alignment is specified by <i>alignment</i>. The default alignment is 0, which means that the widget fills the entire cell.</p>
<p><b>See also </b><a href="qboxlayout.html#addWidget">addWidget</a>() and <a href="qboxlayout.html#insertItem">insertItem</a>().</p>
<!-- @@@insertWidget -->
<!-- $$$invalidate[overload1]$$$invalidate -->
<h3 class="fn"><a name="invalidate"></a><span class="type">void</span> QBoxLayout::<span class="name">invalidate</span> ()<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qlayoutitem.html#invalidate">QLayoutItem::invalidate</a>().</p>
<p>Resets cached information.</p>
<!-- @@@invalidate -->
<!-- $$$itemAt[overload1]$$$itemAtint -->
<h3 class="fn"><a name="itemAt"></a><span class="type"><a href="qlayoutitem.html">QLayoutItem</a></span> * QBoxLayout::<span class="name">itemAt</span> ( <span class="type">int</span> <i>index</i> ) const<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qlayout.html#itemAt">QLayout::itemAt</a>().</p>
<!-- @@@itemAt -->
<!-- $$$maximumSize[overload1]$$$maximumSize -->
<h3 class="fn"><a name="maximumSize"></a><span class="type"><a href="qsize.html">QSize</a></span> QBoxLayout::<span class="name">maximumSize</span> () const<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qlayoutitem.html#maximumSize">QLayoutItem::maximumSize</a>().</p>
<!-- @@@maximumSize -->
<!-- $$$minimumHeightForWidth[overload1]$$$minimumHeightForWidthint -->
<h3 class="fn"><a name="minimumHeightForWidth"></a><span class="type">int</span> QBoxLayout::<span class="name">minimumHeightForWidth</span> ( <span class="type">int</span> <i>w</i> ) const<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qlayoutitem.html#minimumHeightForWidth">QLayoutItem::minimumHeightForWidth</a>().</p>
<!-- @@@minimumHeightForWidth -->
<!-- $$$minimumSize[overload1]$$$minimumSize -->
<h3 class="fn"><a name="minimumSize"></a><span class="type"><a href="qsize.html">QSize</a></span> QBoxLayout::<span class="name">minimumSize</span> () const<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qlayoutitem.html#minimumSize">QLayoutItem::minimumSize</a>().</p>
<!-- @@@minimumSize -->
<!-- $$$setDirection[overload1]$$$setDirectionDirection -->
<h3 class="fn"><a name="setDirection"></a><span class="type">void</span> QBoxLayout::<span class="name">setDirection</span> ( <span class="type"><a href="qboxlayout.html#Direction-enum">Direction</a></span> <i>direction</i> )</h3>
<p>Sets the direction of this layout to <i>direction</i>.</p>
<p><b>See also </b><a href="qboxlayout.html#direction">direction</a>().</p>
<!-- @@@setDirection -->
<!-- $$$setGeometry[overload1]$$$setGeometryconstQRect& -->
<h3 class="fn"><a name="setGeometry"></a><span class="type">void</span> QBoxLayout::<span class="name">setGeometry</span> ( const <span class="type"><a href="qrect.html">QRect</a></span> &amp; <i>r</i> )<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qlayoutitem.html#setGeometry">QLayoutItem::setGeometry</a>().</p>
<!-- @@@setGeometry -->
<!-- $$$setSpacing[overload1]$$$setSpacingint -->
<h3 class="fn"><a name="setSpacing"></a><span class="type">void</span> QBoxLayout::<span class="name">setSpacing</span> ( <span class="type">int</span> <i>spacing</i> )</h3>
<p>Reimplements <a href="qlayout.html#spacing-prop">QLayout::setSpacing</a>(). Sets the spacing property to <i>spacing</i>.</p>
<p><b>See also </b><a href="qlayout.html#spacing-prop">QLayout::setSpacing</a>() and <a href="qboxlayout.html#spacing">spacing</a>().</p>
<!-- @@@setSpacing -->
<!-- $$$setStretch[overload1]$$$setStretchintint -->
<h3 class="fn"><a name="setStretch"></a><span class="type">void</span> QBoxLayout::<span class="name">setStretch</span> ( <span class="type">int</span> <i>index</i>, <span class="type">int</span> <i>stretch</i> )</h3>
<p>Sets the stretch factor at position <i>index</i>. to <i>stretch</i>.</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also </b><a href="qboxlayout.html#stretch">stretch</a>().</p>
<!-- @@@setStretch -->
<!-- $$$setStretchFactor[overload1]$$$setStretchFactorQWidget*int -->
<h3 class="fn"><a name="setStretchFactor"></a><span class="type">bool</span> QBoxLayout::<span class="name">setStretchFactor</span> ( <span class="type"><a href="qwidget.html">QWidget</a></span> * <i>widget</i>, <span class="type">int</span> <i>stretch</i> )</h3>
<p>Sets the stretch factor for <i>widget</i> to <i>stretch</i> and returns true if <i>widget</i> is found in this layout (not including child layouts); otherwise returns false.</p>
<p><b>See also </b><a href="qlayout.html#setAlignment">setAlignment</a>().</p>
<!-- @@@setStretchFactor -->
<!-- $$$setStretchFactor$$$setStretchFactorQLayout*int -->
<h3 class="fn"><a name="setStretchFactor-2"></a><span class="type">bool</span> QBoxLayout::<span class="name">setStretchFactor</span> ( <span class="type"><a href="qlayout.html">QLayout</a></span> * <i>layout</i>, <span class="type">int</span> <i>stretch</i> )</h3>
<p>This is an overloaded function.</p>
<p>Sets the stretch factor for the layout <i>layout</i> to <i>stretch</i> and returns true if <i>layout</i> is found in this layout (not including child layouts); otherwise returns false.</p>
<!-- @@@setStretchFactor -->
<!-- $$$sizeHint[overload1]$$$sizeHint -->
<h3 class="fn"><a name="sizeHint"></a><span class="type"><a href="qsize.html">QSize</a></span> QBoxLayout::<span class="name">sizeHint</span> () const<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qlayoutitem.html#sizeHint">QLayoutItem::sizeHint</a>().</p>
<!-- @@@sizeHint -->
<!-- $$$spacing[overload1]$$$spacing -->
<h3 class="fn"><a name="spacing"></a><span class="type">int</span> QBoxLayout::<span class="name">spacing</span> () const</h3>
<p>Reimplements <a href="qlayout.html#spacing-prop">QLayout::spacing</a>(). If the spacing property is valid, that value is returned. Otherwise, a value for the spacing property is computed and returned. Since layout spacing in a widget is style dependent, if the parent is a widget, it queries the style for the (horizontal or vertical) spacing of the layout. Otherwise, the parent is a layout, and it queries the parent layout for the spacing().</p>
<p><b>See also </b><a href="qlayout.html#spacing-prop">QLayout::spacing</a>() and <a href="qboxlayout.html#setSpacing">setSpacing</a>().</p>
<!-- @@@spacing -->
<!-- $$$stretch[overload1]$$$stretchint -->
<h3 class="fn"><a name="stretch"></a><span class="type">int</span> QBoxLayout::<span class="name">stretch</span> ( <span class="type">int</span> <i>index</i> ) const</h3>
<p>Returns the stretch factor at position <i>index</i>.</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also </b><a href="qboxlayout.html#setStretch">setStretch</a>().</p>
<!-- @@@stretch -->
<!-- $$$takeAt[overload1]$$$takeAtint -->
<h3 class="fn"><a name="takeAt"></a><span class="type"><a href="qlayoutitem.html">QLayoutItem</a></span> * QBoxLayout::<span class="name">takeAt</span> ( <span class="type">int</span> <i>index</i> )<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qlayout.html#takeAt">QLayout::takeAt</a>().</p>
<!-- @@@takeAt -->
</div>
  <div class="ft">
    <span></span>
  </div>
</div> 
<div class="footer">
    <p>
      <acronym title="Copyright">&copy;</acronym> 2012 Nokia Corporation and/or its
      subsidiaries. Documentation contributions included herein are the copyrights of
      their respective owners.</p>
    <br />
    <p>
      The documentation provided herein is licensed under the terms of the
      <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation
      License version 1.3</a> as published by the Free Software Foundation.</p>
    <p>
      Documentation sources may be obtained from <a href="http://www.qt-project.org">
      www.qt-project.org</a>.</p>
    <br />
    <p>
      Nokia, Qt and their respective logos are trademarks of Nokia Corporation 
      in Finland and/or other countries worldwide. All other trademarks are property
      of their respective owners. <a title="Privacy Policy"
      href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
</div>
</body>
</html>