source: trunk/doc/html/qgridlayout.html@ 190

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

reference documentation added

File size: 26.7 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/qlayout.cpp:884 -->
3<html>
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
6<title>QGridLayout 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>QGridLayout Class Reference</h1>
33
34<p>The QGridLayout class lays out widgets in a grid.
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="qlayout.html">QLayout</a>.
38<p><a href="qgridlayout-members.html">List of all member functions.</a>
39<h2>Public Members</h2>
40<ul>
41<li class=fn><a href="#QGridLayout"><b>QGridLayout</b></a> ( QWidget&nbsp;*&nbsp;parent, int&nbsp;nRows = 1, int&nbsp;nCols = 1, int&nbsp;margin = 0, int&nbsp;space = -1, const&nbsp;char&nbsp;*&nbsp;name = 0 )</li>
42<li class=fn><a href="#QGridLayout-2"><b>QGridLayout</b></a> ( int&nbsp;nRows = 1, int&nbsp;nCols = 1, int&nbsp;spacing = -1, const&nbsp;char&nbsp;*&nbsp;name = 0 )</li>
43<li class=fn><a href="#QGridLayout-3"><b>QGridLayout</b></a> ( QLayout&nbsp;*&nbsp;parentLayout, int&nbsp;nRows = 1, int&nbsp;nCols = 1, int&nbsp;spacing = -1, const&nbsp;char&nbsp;*&nbsp;name = 0 )</li>
44<li class=fn><a href="#~QGridLayout"><b>~QGridLayout</b></a> ()</li>
45<li class=fn>virtual QSize <a href="#sizeHint"><b>sizeHint</b></a> () const</li>
46<li class=fn>virtual QSize <a href="#minimumSize"><b>minimumSize</b></a> () const</li>
47<li class=fn>virtual QSize <a href="#maximumSize"><b>maximumSize</b></a> () const</li>
48<li class=fn>virtual void <a href="#setRowStretch"><b>setRowStretch</b></a> ( int&nbsp;row, int&nbsp;stretch )</li>
49<li class=fn>virtual void <a href="#setColStretch"><b>setColStretch</b></a> ( int&nbsp;col, int&nbsp;stretch )</li>
50<li class=fn>int <a href="#rowStretch"><b>rowStretch</b></a> ( int&nbsp;row ) const</li>
51<li class=fn>int <a href="#colStretch"><b>colStretch</b></a> ( int&nbsp;col ) const</li>
52<li class=fn>void <a href="#setRowSpacing"><b>setRowSpacing</b></a> ( int&nbsp;row, int&nbsp;minSize )</li>
53<li class=fn>void <a href="#setColSpacing"><b>setColSpacing</b></a> ( int&nbsp;col, int&nbsp;minSize )</li>
54<li class=fn>int <a href="#rowSpacing"><b>rowSpacing</b></a> ( int&nbsp;row ) const</li>
55<li class=fn>int <a href="#colSpacing"><b>colSpacing</b></a> ( int&nbsp;col ) const</li>
56<li class=fn>int <a href="#numRows"><b>numRows</b></a> () const</li>
57<li class=fn>int <a href="#numCols"><b>numCols</b></a> () const</li>
58<li class=fn>QRect <a href="#cellGeometry"><b>cellGeometry</b></a> ( int&nbsp;row, int&nbsp;col ) const</li>
59<li class=fn>virtual bool <a href="#hasHeightForWidth"><b>hasHeightForWidth</b></a> () const</li>
60<li class=fn>virtual int <a href="#heightForWidth"><b>heightForWidth</b></a> ( int&nbsp;w ) const</li>
61<li class=fn>virtual QSizePolicy::ExpandData <a href="#expanding"><b>expanding</b></a> () const</li>
62<li class=fn>virtual void <a href="#invalidate"><b>invalidate</b></a> ()</li>
63<li class=fn>virtual void <a href="#addItem-2"><b>addItem</b></a> ( QLayoutItem&nbsp;*&nbsp;item )</li>
64<li class=fn>void <a href="#addItem"><b>addItem</b></a> ( QLayoutItem&nbsp;*&nbsp;item, int&nbsp;row, int&nbsp;col )</li>
65<li class=fn>void <a href="#addMultiCell"><b>addMultiCell</b></a> ( QLayoutItem&nbsp;*&nbsp;item, int&nbsp;fromRow, int&nbsp;toRow, int&nbsp;fromCol, int&nbsp;toCol, int&nbsp;alignment = 0 )</li>
66<li class=fn>void <a href="#addWidget"><b>addWidget</b></a> ( QWidget&nbsp;*&nbsp;w, int&nbsp;row, int&nbsp;col, int&nbsp;alignment = 0 )</li>
67<li class=fn>void <a href="#addMultiCellWidget"><b>addMultiCellWidget</b></a> ( QWidget&nbsp;*&nbsp;w, int&nbsp;fromRow, int&nbsp;toRow, int&nbsp;fromCol, int&nbsp;toCol, int&nbsp;alignment = 0 )</li>
68<li class=fn>void <a href="#addLayout"><b>addLayout</b></a> ( QLayout&nbsp;*&nbsp;layout, int&nbsp;row, int&nbsp;col )</li>
69<li class=fn>void <a href="#addMultiCellLayout"><b>addMultiCellLayout</b></a> ( QLayout&nbsp;*&nbsp;layout, int&nbsp;fromRow, int&nbsp;toRow, int&nbsp;fromCol, int&nbsp;toCol, int&nbsp;alignment = 0 )</li>
70<li class=fn>void addRowSpacing ( int&nbsp;row, int&nbsp;minsize ) &nbsp;<em>(obsolete)</em></li>
71<li class=fn>void addColSpacing ( int&nbsp;col, int&nbsp;minsize ) &nbsp;<em>(obsolete)</em></li>
72<li class=fn>void <a href="#expand"><b>expand</b></a> ( int&nbsp;nRows, int&nbsp;nCols )</li>
73<li class=fn>enum <a href="#Corner-enum"><b>Corner</b></a> { TopLeft, TopRight, BottomLeft, BottomRight }</li>
74<li class=fn>void <a href="#setOrigin"><b>setOrigin</b></a> ( Corner&nbsp;c )</li>
75<li class=fn>Corner <a href="#origin"><b>origin</b></a> () const</li>
76<li class=fn>virtual void <a href="#setGeometry"><b>setGeometry</b></a> ( const&nbsp;QRect&nbsp;&amp;&nbsp;r )</li>
77</ul>
78<h2>Protected Members</h2>
79<ul>
80<li class=fn>bool <a href="#findWidget"><b>findWidget</b></a> ( QWidget&nbsp;*&nbsp;w, int&nbsp;*&nbsp;row, int&nbsp;*&nbsp;col )</li>
81<li class=fn>void <a href="#add"><b>add</b></a> ( QLayoutItem&nbsp;*&nbsp;item, int&nbsp;row, int&nbsp;col )</li>
82</ul>
83<hr><a name="details"></a><h2>Detailed Description</h2>
84
85
86<p> The QGridLayout class lays out widgets in a grid.
87<p>
88
89
90<p> QGridLayout takes the space made available to it (by its parent
91layout or by the <a href="qlayout.html#mainWidget">mainWidget</a>()), divides it up into rows and
92columns, and puts each widget it manages into the correct cell.
93<p> Columns and rows behave identically; we will discuss columns, but
94there are equivalent functions for rows.
95<p> Each column has a minimum width and a <a href="layout.html#stretch-factor">stretch factor</a>. The minimum
96width is the greatest of that set using <a href="#addColSpacing">addColSpacing</a>() and the
97minimum width of each widget in that column. The stretch factor is
98set using <a href="#setColStretch">setColStretch</a>() and determines how much of the available
99space the column will get over and above its necessary minimum.
100<p> Normally, each managed widget or layout is put into a cell of its
101own using <a href="#addWidget">addWidget</a>(), <a href="#addLayout">addLayout</a>() or by the <a href="qlayout.html#setAutoAdd">auto-add facility</a>. It is also
102possible for a widget to occupy multiple cells using
103<a href="#addMultiCellWidget">addMultiCellWidget</a>(). If you do this, QGridLayout will guess how
104to distribute the size over the columns/rows (based on the stretch
105factors).
106<p> To remove a widget from a layout, call <a href="qlayout.html#remove">remove</a>(). Calling
107<a href="qwidget.html#hide">QWidget::hide</a>() on a widget also effectively removes the widget
108from the layout until <a href="qwidget.html#show">QWidget::show</a>() is called.
109<p> This illustration shows a fragment of a dialog with a five-column,
110three-row grid (the grid is shown overlaid in magenta):
111<p> <center><img src="gridlayout.png"></center>
112<p> Columns 0, 2 and 4 in this dialog fragment are made up of a
113<a href="qlabel.html">QLabel</a>, a <a href="qlineedit.html">QLineEdit</a>, and a <a href="qlistbox.html">QListBox</a>. Columns 1 and 3 are
114placeholders made with <a href="#addColSpacing">addColSpacing</a>(). Row 0 consists of three
115QLabel objects, row 1 of three QLineEdit objects and row 2 of
116three QListBox objects. We used placeholder columns (1 and 3) to
117get the right amount of space between the columns.
118<p> Note that the columns and rows are not equally wide or tall. If
119you want two columns to have the same width, you must set their
120minimum widths and stretch factors to be the same yourself. You do
121this using addColSpacing() and <a href="#setColStretch">setColStretch</a>().
122<p> If the QGridLayout is not the top-level layout (i.e. does not
123manage all of the widget's area and children), you must add it to
124its parent layout when you create it, but before you do anything
125with it. The normal way to add a layout is by calling
126parentLayout-&gt;addLayout().
127<p> Once you have added your layout you can start putting widgets and
128other layouts into the cells of your grid layout using
129<a href="#addWidget">addWidget</a>(), <a href="#addLayout">addLayout</a>() and <a href="#addMultiCellWidget">addMultiCellWidget</a>().
130<p> QGridLayout also includes two margin widths: the border and the
131spacing. The border is the width of the reserved space along each
132of the QGridLayout's four sides. The spacing is the width of the
133automatically allocated spacing between neighboring boxes.
134<p> Both the border and the spacing are parameters of the constructor
135and default to 0.
136<p> <p>See also <a href="qgrid.html">QGrid</a>, <a href="layout.html">Layout Overview</a>, <a href="appearance.html">Widget Appearance and Style</a>, and <a href="geomanagement.html">Layout Management</a>.
137
138<hr><h2>Member Type Documentation</h2>
139<h3 class=fn><a name="Corner-enum"></a>QGridLayout::Corner</h3>
140
141<p> This enum identifies which corner is the origin (0, 0) of the
142layout.
143<ul>
144<li><tt>QGridLayout::TopLeft</tt> - the top-left corner
145<li><tt>QGridLayout::TopRight</tt> - the top-right corner
146<li><tt>QGridLayout::BottomLeft</tt> - the bottom-left corner
147<li><tt>QGridLayout::BottomRight</tt> - the bottom-right corner
148</ul>
149<hr><h2>Member Function Documentation</h2>
150<h3 class=fn><a name="QGridLayout"></a>QGridLayout::QGridLayout ( <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;parent, int&nbsp;nRows = 1, int&nbsp;nCols = 1, int&nbsp;margin = 0, int&nbsp;space = -1, const&nbsp;char&nbsp;*&nbsp;name = 0 )
151</h3>
152Constructs a new QGridLayout with <em>nRows</em> rows, <em>nCols</em> columns
153and parent widget, <em>parent</em>. <em>parent</em> may not be 0. The grid
154layout is called <em>name</em>.
155<p> <em>margin</em> is the number of pixels between the edge of the widget
156and its managed children. <em>space</em> is the default number of pixels
157between cells. If <em>space</em> is -1, the value of <em>margin</em> is used.
158
159<h3 class=fn><a name="QGridLayout-2"></a>QGridLayout::QGridLayout ( int&nbsp;nRows = 1, int&nbsp;nCols = 1, int&nbsp;spacing = -1, const&nbsp;char&nbsp;*&nbsp;name = 0 )
160</h3>
161Constructs a new grid with <em>nRows</em> rows and <em>nCols</em> columns. If
162<em>spacing</em> is -1, this QGridLayout inherits its parent's
163<a href="qlayout.html#spacing">spacing</a>(); otherwise <em>spacing</em> is used. The grid layout is called
164<em>name</em>.
165<p> You must insert this grid into another layout. You can insert
166widgets and layouts into this layout at any time, but laying out
167will not be performed before this is inserted into another layout.
168
169<h3 class=fn><a name="QGridLayout-3"></a>QGridLayout::QGridLayout ( <a href="qlayout.html">QLayout</a>&nbsp;*&nbsp;parentLayout, int&nbsp;nRows = 1, int&nbsp;nCols = 1, int&nbsp;spacing = -1, const&nbsp;char&nbsp;*&nbsp;name = 0 )
170</h3>
171Constructs a new grid that is placed inside <em>parentLayout</em> with
172<em>nRows</em> rows and <em>nCols</em> columns. If <em>spacing</em> is -1, this
173QGridLayout inherits its parent's <a href="qlayout.html#spacing">spacing</a>(); otherwise <em>spacing</em>
174is used. The grid layout is called <em>name</em>.
175<p> This grid is placed according to <em>parentLayout</em>'s default
176placement rules.
177
178<h3 class=fn><a name="~QGridLayout"></a>QGridLayout::~QGridLayout ()
179</h3>
180Destroys the grid layout. Geometry management is terminated if
181this is a top-level grid.
182<p> The layout's widgets aren't destroyed.
183
184<h3 class=fn>void <a name="add"></a>QGridLayout::add ( <a href="qlayoutitem.html">QLayoutItem</a>&nbsp;*&nbsp;item, int&nbsp;row, int&nbsp;col )<tt> [protected]</tt>
185</h3>
186Adds <em>item</em> at position <em>row</em>, <em>col</em>. The layout takes
187ownership of the <em>item</em>.
188
189<h3 class=fn>void <a name="addColSpacing"></a>QGridLayout::addColSpacing ( int&nbsp;col, int&nbsp;minsize )
190</h3>
191<b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
192<p> Sets the minimum width of column <em>col</em> to <em>minsize</em> pixels.
193<p> Use <a href="#setColSpacing">setColSpacing</a>() instead.
194
195<h3 class=fn>void <a name="addItem"></a>QGridLayout::addItem ( <a href="qlayoutitem.html">QLayoutItem</a>&nbsp;*&nbsp;item, int&nbsp;row, int&nbsp;col )
196</h3>
197Adds <em>item</em> at position <em>row</em>, <em>col</em>. The layout takes
198ownership of the <em>item</em>.
199
200<h3 class=fn>void <a name="addItem-2"></a>QGridLayout::addItem ( <a href="qlayoutitem.html">QLayoutItem</a>&nbsp;*&nbsp;item )<tt> [virtual]</tt>
201</h3>
202This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
203<p> Adds <em>item</em> to the next free position of this layout.
204
205<p>Reimplemented from <a href="qlayout.html#addItem">QLayout</a>.
206<h3 class=fn>void <a name="addLayout"></a>QGridLayout::addLayout ( <a href="qlayout.html">QLayout</a>&nbsp;*&nbsp;layout, int&nbsp;row, int&nbsp;col )
207</h3>
208Places the <em>layout</em> at position (<em>row</em>, <em>col</em>) in the grid. The
209top-left position is (0, 0).
210<p> <em>layout</em> becomes a child of the grid layout.
211<p> When a layout is constructed with another layout as its parent,
212you don't need to call <a href="#addLayout">addLayout</a>(); the child layout is
213automatically added to the parent layout as it is constructed.
214<p> <p>See also <a href="#addMultiCellLayout">addMultiCellLayout</a>().
215
216<p>Examples: <a href="listbox-example.html#x1430">listbox/listbox.cpp</a>, <a href="progressbar-example.html#x964">progressbar/progressbar.cpp</a>, <a href="tutorial1-10.html#x2365">t10/main.cpp</a>, and <a href="tutorial1-13.html#x2413">t13/gamebrd.cpp</a>.
217<h3 class=fn>void <a name="addMultiCell"></a>QGridLayout::addMultiCell ( <a href="qlayoutitem.html">QLayoutItem</a>&nbsp;*&nbsp;item, int&nbsp;fromRow, int&nbsp;toRow, int&nbsp;fromCol, int&nbsp;toCol, int&nbsp;alignment = 0 )
218</h3>
219Adds the <em>item</em> to the cell grid, spanning multiple rows/columns.
220<p> The cell will span from <em>fromRow</em>, <em>fromCol</em> to <em>toRow</em>, <em>toCol</em>. Alignment is specified by <em>alignment</em>, which is a bitwise
221OR of <a href="qt.html#AlignmentFlags-enum">Qt::AlignmentFlags</a> values. The default alignment is 0,
222which means that the widget fills the entire cell.
223
224<h3 class=fn>void <a name="addMultiCellLayout"></a>QGridLayout::addMultiCellLayout ( <a href="qlayout.html">QLayout</a>&nbsp;*&nbsp;layout, int&nbsp;fromRow, int&nbsp;toRow, int&nbsp;fromCol, int&nbsp;toCol, int&nbsp;alignment = 0 )
225</h3>
226Adds the layout <em>layout</em> to the cell grid, spanning multiple
227rows/columns. The cell will span from <em>fromRow</em>, <em>fromCol</em> to <em>toRow</em>, <em>toCol</em>.
228<p> Alignment is specified by <em>alignment</em>, which is a bitwise OR of
229<a href="qt.html#AlignmentFlags-enum">Qt::AlignmentFlags</a> values. The default alignment is 0, which
230means that the widget fills the entire cell.
231<p> A non-zero alignment indicates that the layout should not grow to
232fill the available space but should be sized according to
233<a href="#sizeHint">sizeHint</a>().
234<p> <em>layout</em> becomes a child of the grid layout.
235<p> <p>See also <a href="#addLayout">addLayout</a>().
236
237<h3 class=fn>void <a name="addMultiCellWidget"></a>QGridLayout::addMultiCellWidget ( <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;w, int&nbsp;fromRow, int&nbsp;toRow, int&nbsp;fromCol, int&nbsp;toCol, int&nbsp;alignment = 0 )
238</h3>
239Adds the widget <em>w</em> to the cell grid, spanning multiple
240rows/columns. The cell will span from <em>fromRow</em>, <em>fromCol</em> to <em>toRow</em>, <em>toCol</em>.
241<p> Alignment is specified by <em>alignment</em>, which is a bitwise OR of
242<a href="qt.html#AlignmentFlags-enum">Qt::AlignmentFlags</a> values. The default alignment is 0, which
243means that the widget fills the entire cell.
244<p> A non-zero alignment indicates that the widget should not grow to
245fill the available space but should be sized according to
246<a href="#sizeHint">sizeHint</a>().
247<p> <p>See also <a href="#addWidget">addWidget</a>().
248
249<p>Examples: <a href="cursor-example.html#x1116">cursor/cursor.cpp</a>, <a href="layout-example.html#x532">layout/layout.cpp</a>, and <a href="progressbar-example.html#x965">progressbar/progressbar.cpp</a>.
250<h3 class=fn>void <a name="addRowSpacing"></a>QGridLayout::addRowSpacing ( int&nbsp;row, int&nbsp;minsize )
251</h3>
252<b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
253<p> Sets the minimum height of row <em>row</em> to <em>minsize</em> pixels.
254<p> Use <a href="#setRowSpacing">setRowSpacing</a>() instead.
255
256<h3 class=fn>void <a name="addWidget"></a>QGridLayout::addWidget ( <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;w, int&nbsp;row, int&nbsp;col, int&nbsp;alignment = 0 )
257</h3>
258Adds the widget <em>w</em> to the cell grid at <em>row</em>, <em>col</em>. The
259top-left position is (0, 0) by default.
260<p> Alignment is specified by <em>alignment</em>, which is a bitwise OR of
261<a href="qt.html#AlignmentFlags-enum">Qt::AlignmentFlags</a> values. The default alignment is 0, which
262means that the widget fills the entire cell.
263<p> <ul>
264<li> You should not call this if you have enabled the
265<a href="qlayout.html#setAutoAdd">auto-add facility of the layout</a>.
266<p> <li> From Qt 3.0, the <em>alignment</em> parameter is interpreted more
267aggressively than in previous versions of Qt. A non-default
268alignment now indicates that the widget should not grow to fill
269the available space, but should be sized according to <a href="#sizeHint">sizeHint</a>().
270</ul>
271<p> <p>See also <a href="#addMultiCellWidget">addMultiCellWidget</a>().
272
273<p>Examples: <a href="addressbook-example.html#x578">addressbook/centralwidget.cpp</a>, <a href="layout-example.html#x533">layout/layout.cpp</a>, <a href="rot-example.html#x1370">rot13/rot13.cpp</a>, <a href="sql.html#x2221">sql/overview/form1/main.cpp</a>, <a href="sql.html#x2230">sql/overview/form2/main.cpp</a>, <a href="tutorial1-14.html#x2441">t14/gamebrd.cpp</a>, and <a href="tutorial1-08.html#x2337">t8/main.cpp</a>.
274<h3 class=fn><a href="qrect.html">QRect</a> <a name="cellGeometry"></a>QGridLayout::cellGeometry ( int&nbsp;row, int&nbsp;col ) const
275</h3>
276Returns the geometry of the cell with row <em>row</em> and column <em>col</em>
277in the grid. Returns an invalid rectangle if <em>row</em> or <em>col</em> is
278outside the grid.
279<p> <b>Warning:</b> in the current version of Qt this function does not
280return valid results until <a href="#setGeometry">setGeometry</a>() has been called, i.e.
281after the <a href="qlayout.html#mainWidget">mainWidget</a>() is visible.
282
283<h3 class=fn>int <a name="colSpacing"></a>QGridLayout::colSpacing ( int&nbsp;col ) const
284</h3>
285Returns the column spacing for column <em>col</em>.
286<p> <p>See also <a href="#setColSpacing">setColSpacing</a>().
287
288<h3 class=fn>int <a name="colStretch"></a>QGridLayout::colStretch ( int&nbsp;col ) const
289</h3>
290Returns the <a href="layout.html#stretch-factor">stretch factor</a> for column <em>col</em>.
291<p> <p>See also <a href="#setColStretch">setColStretch</a>().
292
293<h3 class=fn>void <a name="expand"></a>QGridLayout::expand ( int&nbsp;nRows, int&nbsp;nCols )
294</h3>
295Expands this grid so that it will have <em>nRows</em> rows and <em>nCols</em>
296columns. Will not shrink the grid. You should not need to call
297this function because QGridLayout expands automatically as new
298items are inserted.
299
300<h3 class=fn><a href="qsizepolicy.html#ExpandData-enum">QSizePolicy::ExpandData</a> <a name="expanding"></a>QGridLayout::expanding () const<tt> [virtual]</tt>
301</h3>
302Returns whether this layout can make use of more space than
303<a href="#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
304to grow in only one dimension, whereas <tt>BothDirections</tt> means that
305it wants to grow in both dimensions.
306
307<p>Reimplemented from <a href="qlayout.html#expanding">QLayout</a>.
308<h3 class=fn>bool <a name="findWidget"></a>QGridLayout::findWidget ( <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;w, int&nbsp;*&nbsp;row, int&nbsp;*&nbsp;col )<tt> [protected]</tt>
309</h3>
310Searches for widget <em>w</em> in this layout (not including child
311layouts). If <em>w</em> is found, it sets <tt>&lt;em&gt;row&lt;/em&gt;</tt> and <tt>&lt;em&gt;col&lt;/em&gt;</tt> to
312the row and column and returns TRUE; otherwise returns FALSE.
313<p> Note: if a widget spans multiple rows/columns, the top-left cell
314is returned.
315
316<h3 class=fn>bool <a name="hasHeightForWidth"></a>QGridLayout::hasHeightForWidth () const<tt> [virtual]</tt>
317</h3>
318Returns TRUE if this layout's preferred height depends on its
319width; otherwise returns FALSE.
320
321<p>Reimplemented from <a href="qlayoutitem.html#hasHeightForWidth">QLayoutItem</a>.
322<h3 class=fn>int <a name="heightForWidth"></a>QGridLayout::heightForWidth ( int&nbsp;w ) const<tt> [virtual]</tt>
323</h3>
324Returns the layout's preferred height when it is <em>w</em> pixels wide.
325
326<p>Reimplemented from <a href="qlayoutitem.html#heightForWidth">QLayoutItem</a>.
327<h3 class=fn>void <a name="invalidate"></a>QGridLayout::invalidate ()<tt> [virtual]</tt>
328</h3>
329Resets cached information.
330
331<p>Reimplemented from <a href="qlayout.html#invalidate">QLayout</a>.
332<h3 class=fn><a href="qsize.html">QSize</a> <a name="maximumSize"></a>QGridLayout::maximumSize () const<tt> [virtual]</tt>
333</h3>
334Returns the maximum size needed by this grid.
335
336<p>Reimplemented from <a href="qlayout.html#maximumSize">QLayout</a>.
337<h3 class=fn><a href="qsize.html">QSize</a> <a name="minimumSize"></a>QGridLayout::minimumSize () const<tt> [virtual]</tt>
338</h3>
339Returns the minimum size needed by this grid.
340
341<p>Reimplemented from <a href="qlayout.html#minimumSize">QLayout</a>.
342<h3 class=fn>int <a name="numCols"></a>QGridLayout::numCols () const
343</h3>
344Returns the number of columns in this grid.
345
346<h3 class=fn>int <a name="numRows"></a>QGridLayout::numRows () const
347</h3>
348Returns the number of rows in this grid.
349
350<h3 class=fn><a href="qgridlayout.html#Corner-enum">Corner</a> <a name="origin"></a>QGridLayout::origin () const
351</h3>
352Returns the corner that's used for the grid's origin, i.e. for
353position (0, 0).
354
355<h3 class=fn>int <a name="rowSpacing"></a>QGridLayout::rowSpacing ( int&nbsp;row ) const
356</h3>
357Returns the row spacing for row <em>row</em>.
358<p> <p>See also <a href="#setRowSpacing">setRowSpacing</a>().
359
360<h3 class=fn>int <a name="rowStretch"></a>QGridLayout::rowStretch ( int&nbsp;row ) const
361</h3>
362Returns the <a href="layout.html#stretch-factor">stretch factor</a> for row <em>row</em>.
363<p> <p>See also <a href="#setRowStretch">setRowStretch</a>().
364
365<h3 class=fn>void <a name="setColSpacing"></a>QGridLayout::setColSpacing ( int&nbsp;col, int&nbsp;minSize )
366</h3>
367Sets the minimum width of column <em>col</em> to <em>minSize</em> pixels.
368<p> <p>See also <a href="#colSpacing">colSpacing</a>() and <a href="#setRowSpacing">setRowSpacing</a>().
369
370<h3 class=fn>void <a name="setColStretch"></a>QGridLayout::setColStretch ( int&nbsp;col, int&nbsp;stretch )<tt> [virtual]</tt>
371</h3>
372Sets the <a href="layout.html#stretch-factor">stretch factor</a> of column <em>col</em> to <em>stretch</em>. The first
373column is number 0.
374<p> The stretch factor is relative to the other columns in this grid.
375Columns with a higher stretch factor take more of the available
376space.
377<p> The default stretch factor is 0. If the stretch factor is 0 and no
378other column in this table can grow at all, the column may still
379grow.
380<p> <p>See also <a href="#colStretch">colStretch</a>(), <a href="#addColSpacing">addColSpacing</a>(), and <a href="#setRowStretch">setRowStretch</a>().
381
382<p>Examples: <a href="layout-example.html#x534">layout/layout.cpp</a>, <a href="tutorial1-14.html#x2442">t14/gamebrd.cpp</a>, and <a href="tutorial1-08.html#x2338">t8/main.cpp</a>.
383<h3 class=fn>void <a name="setGeometry"></a>QGridLayout::setGeometry ( const&nbsp;<a href="qrect.html">QRect</a>&nbsp;&amp;&nbsp;r )<tt> [virtual]</tt>
384</h3>
385Resizes managed widgets within the rectangle <em>r</em>.
386
387<p>Reimplemented from <a href="qlayout.html#setGeometry">QLayout</a>.
388<h3 class=fn>void <a name="setOrigin"></a>QGridLayout::setOrigin ( <a href="qgridlayout.html#Corner-enum">Corner</a>&nbsp;c )
389</h3>
390Sets the grid's origin corner, i.e. position (0, 0), to <em>c</em>.
391
392<h3 class=fn>void <a name="setRowSpacing"></a>QGridLayout::setRowSpacing ( int&nbsp;row, int&nbsp;minSize )
393</h3>
394Sets the minimum height of row <em>row</em> to <em>minSize</em> pixels.
395<p> <p>See also <a href="#rowSpacing">rowSpacing</a>() and <a href="#setColSpacing">setColSpacing</a>().
396
397<h3 class=fn>void <a name="setRowStretch"></a>QGridLayout::setRowStretch ( int&nbsp;row, int&nbsp;stretch )<tt> [virtual]</tt>
398</h3>
399Sets the <a href="layout.html#stretch-factor">stretch factor</a> of row <em>row</em> to <em>stretch</em>. The first row
400is number 0.
401<p> The stretch factor is relative to the other rows in this grid.
402Rows with a higher stretch factor take more of the available
403space.
404<p> The default stretch factor is 0. If the stretch factor is 0 and no
405other row in this table can grow at all, the row may still grow.
406<p> <p>See also <a href="#rowStretch">rowStretch</a>(), <a href="#setRowSpacing">setRowSpacing</a>(), and <a href="#setColStretch">setColStretch</a>().
407
408<p>Examples: <a href="addressbook-example.html#x579">addressbook/centralwidget.cpp</a> and <a href="qaxcontainer-example-qutlook.html#x2722">qutlook/centralwidget.cpp</a>.
409<h3 class=fn><a href="qsize.html">QSize</a> <a name="sizeHint"></a>QGridLayout::sizeHint () const<tt> [virtual]</tt>
410</h3>
411Returns the preferred size of this grid.
412
413<p>Reimplemented from <a href="qlayoutitem.html#sizeHint">QLayoutItem</a>.
414<!-- eof -->
415<hr><p>
416This file is part of the <a href="index.html">Qt toolkit</a>.
417Copyright &copy; 1995-2007
418<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
419<table width=100% cellspacing=0 border=0><tr>
420<td>Copyright &copy; 2007
421<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
422<td align=right><div align=right>Qt 3.3.8</div>
423</table></div></address></body>
424</html>
Note: See TracBrowser for help on using the repository browser.