qgridlayout.html

来自「QT 下载资料仅供参考」· HTML 代码 · 共 386 行 · 第 1/2 页

HTML
386
字号
<h3 class=fn>void <a name="addItem-2"></a>QGridLayout::addItem ( <a href="qlayoutitem.html">QLayoutItem</a>&nbsp;*&nbsp;item )<tt> [virtual]</tt></h3>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.<p> Adds <em>item</em> to the next free position of this layout.<p>Reimplemented from <a href="qlayout.html#addItem">QLayout</a>.<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 )</h3>Places the <em>layout</em> at position (<em>row</em>, <em>col</em>) in the grid. Thetop-left position is (0, 0).<p>Examples: <a href="listbox-example.html#x1313">listbox/listbox.cpp</a>, <a href="progressbar-example.html#x1108">progressbar/progressbar.cpp</a>, <a href="tutorial1-10.html#x2352">t10/main.cpp</a> and <a href="tutorial1-13.html#x2400">t13/gamebrd.cpp</a>.<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 )</h3>Adds the <em>item</em> to the cell grid, spanning multiple rows/columns.<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 bitwiseOR of <a href="qt.html#AlignmentFlags-enum">Qt::AlignmentFlags</a> values. The default alignment is 0,which means that the widget fills the entire cell.<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 )</h3>Adds the layout <em>layout</em> to the cell grid, spanning multiplerows/columns. The cell will span from <em>fromRow</em>, <em>fromCol</em> to <em>toRow</em>, <em>toCol</em>.<p> Alignment is specified by <em>alignment</em>, which is a bitwise OR of<a href="qt.html#AlignmentFlags-enum">Qt::AlignmentFlags</a> values. The default alignment is 0, whichmeans that the widget fills the entire cell.<p> A non-zero alignment indicates that the layout should not grow tofill the available space but should be sized according to<a href="#sizeHint">sizeHint</a>().<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 )</h3>Adds the widget <em>w</em> to the cell grid, spanning multiplerows/columns. The cell will span from <em>fromRow</em>, <em>fromCol</em> to <em>toRow</em>, <em>toCol</em>.<p> Alignment is specified by <em>alignment</em>, which is a bitwise OR of<a href="qt.html#AlignmentFlags-enum">Qt::AlignmentFlags</a> values. The default alignment is 0, whichmeans that the widget fills the entire cell.<p> A non-zero alignment indicates that the widget should not grow tofill the available space but should be sized according to<a href="#sizeHint">sizeHint</a>().<p>Examples: <a href="cursor-example.html#x915">cursor/cursor.cpp</a>, <a href="layout-example.html#x483">layout/layout.cpp</a> and <a href="progressbar-example.html#x1109">progressbar/progressbar.cpp</a>.<h3 class=fn>void <a name="addRowSpacing"></a>QGridLayout::addRowSpacing ( int&nbsp;row, int&nbsp;minsize )</h3>Sets the minimum height of row <em>row</em> to <em>minsize</em> pixels.<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 )</h3>Adds the widget <em>w</em> to the cell grid at <em>row</em>, <em>col</em>. Thetop-left position is (0, 0) by default.<p> Alignment is specified by <em>alignment</em>, which is a bitwise OR of<a href="qt.html#AlignmentFlags-enum">Qt::AlignmentFlags</a> values. The default alignment is 0, whichmeans that the widget fills the entire cell.<p> <ul><li> You should not call this if you have enabled the<a href="qlayout.html#setAutoAdd">auto-add facility of the layout</a>.<p> <li> From Qt 3.0, the <em>alignment</em> parameter is interpreted moreaggressively than in previous versions of Qt. A non-defaultalignment now indicates that the widget should not grow to fillthe available space, but should be sized according to <a href="#sizeHint">sizeHint</a>().</ul><p>Examples: <a href="addressbook-example.html#x527">addressbook/centralwidget.cpp</a>, <a href="layout-example.html#x484">layout/layout.cpp</a>, <a href="rot-example.html#x1556">rot13/rot13.cpp</a>, <a href="sql.html#x2220">sql/overview/form1/main.cpp</a>, <a href="sql.html#x2229">sql/overview/form2/main.cpp</a>, <a href="tutorial1-14.html#x2428">t14/gamebrd.cpp</a> and <a href="tutorial1-08.html#x2324">t8/main.cpp</a>.<h3 class=fn><a href="qrect.html">QRect</a> <a name="cellGeometry"></a>QGridLayout::cellGeometry ( int&nbsp;row, int&nbsp;col ) const</h3>Returns the geometry of the cell with row <em>row</em> and column <em>col</em>in the grid. Returns an invalid rectangle if <em>row</em> or <em>col</em> isoutside the grid.<p> <b>Warning:</b> in the current version of Qt this function does notreturn valid results until <a href="#setGeometry">setGeometry</a>() has been called, i.e.after the <a href="qlayout.html#mainWidget">mainWidget</a>() is visible.<h3 class=fn>int <a name="colStretch"></a>QGridLayout::colStretch ( int&nbsp;col ) const</h3>Returns the <a href="layout.html#stretch-factor">stretch factor</a> for column <em>col</em>.<p> <p>See also <a href="#setColStretch">setColStretch</a>().<h3 class=fn>void <a name="expand"></a>QGridLayout::expand ( int&nbsp;nRows, int&nbsp;nCols )</h3>Expands this grid so that it will have <em>nRows</em> rows and <em>nCols</em>columns. Will not shrink the grid. You should not need to callthis function because QGridLayout expands automatically as newitems are inserted.<h3 class=fn><a href="qsizepolicy.html#ExpandData-enum">QSizePolicy::ExpandData</a> <a name="expanding"></a>QGridLayout::expanding () const<tt> [virtual]</tt></h3>Returns the expansiveness of this layout.<p>Reimplemented from <a href="qlayout.html#expanding">QLayout</a>.<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></h3>Searches for widget <em>w</em> in this layout (not including childlayouts). 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> tothe row and column and returns TRUE; otherwise returns FALSE.<p> Note: if a widget spans multiple rows/columns, the top-left cellis returned.<h3 class=fn>bool <a name="hasHeightForWidth"></a>QGridLayout::hasHeightForWidth () const<tt> [virtual]</tt></h3>Returns TRUE if this layout's preferred height depends on itswidth; otherwise returns FALSE.<p>Reimplemented from <a href="qlayoutitem.html#hasHeightForWidth">QLayoutItem</a>.<h3 class=fn>int <a name="heightForWidth"></a>QGridLayout::heightForWidth ( int&nbsp;w ) const<tt> [virtual]</tt></h3>Returns the layout's preferred height when it is <em>w</em> pixels wide.<p>Reimplemented from <a href="qlayoutitem.html#heightForWidth">QLayoutItem</a>.<h3 class=fn>void <a name="invalidate"></a>QGridLayout::invalidate ()<tt> [virtual]</tt></h3>Resets cached information.<p>Reimplemented from <a href="qlayout.html#invalidate">QLayout</a>.<h3 class=fn><a href="qsize.html">QSize</a> <a name="maximumSize"></a>QGridLayout::maximumSize () const<tt> [virtual]</tt></h3>Returns the maximum size needed by this grid.<p>Reimplemented from <a href="qlayout.html#maximumSize">QLayout</a>.<h3 class=fn><a href="qsize.html">QSize</a> <a name="minimumSize"></a>QGridLayout::minimumSize () const<tt> [virtual]</tt></h3>Returns the minimum size needed by this grid.<p>Reimplemented from <a href="qlayout.html#minimumSize">QLayout</a>.<h3 class=fn>int <a name="numCols"></a>QGridLayout::numCols () const</h3>Returns the number of columns in this grid.<h3 class=fn>int <a name="numRows"></a>QGridLayout::numRows () const</h3>Returns the number of rows in this grid.<h3 class=fn><a href="qgridlayout.html#Corner-enum">Corner</a> <a name="origin"></a>QGridLayout::origin () const</h3>Returns the corner that's used for the grid's origin, i.e. forposition (0, 0).<h3 class=fn>int <a name="rowStretch"></a>QGridLayout::rowStretch ( int&nbsp;row ) const</h3>Returns the <a href="layout.html#stretch-factor">stretch factor</a> for row <em>row</em>.<p> <p>See also <a href="#setRowStretch">setRowStretch</a>().<h3 class=fn>void <a name="setColStretch"></a>QGridLayout::setColStretch ( int&nbsp;col, int&nbsp;stretch )<tt> [virtual]</tt></h3>Sets the <a href="layout.html#stretch-factor">stretch factor</a> of column <em>col</em> to <em>stretch</em>. The firstcolumn is number 0.<p> The stretch factor is relative to the other columns in this grid.Columns with a higher stretch factor take more of the availablespace.<p> The default stretch factor is 0. If the stretch factor is 0 and noother column in this table can grow at all, the column may stillgrow.<p> <p>See also <a href="#colStretch">colStretch</a>(), <a href="#addColSpacing">addColSpacing</a>() and <a href="#setRowStretch">setRowStretch</a>().<p>Examples: <a href="layout-example.html#x485">layout/layout.cpp</a>, <a href="tutorial1-14.html#x2429">t14/gamebrd.cpp</a> and <a href="tutorial1-08.html#x2325">t8/main.cpp</a>.<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></h3>Resizes managed widgets within the rectangle <em>r</em>.<p>Reimplemented from <a href="qlayout.html#setGeometry">QLayout</a>.<h3 class=fn>void <a name="setOrigin"></a>QGridLayout::setOrigin ( <a href="qgridlayout.html#Corner-enum">Corner</a>&nbsp;c )</h3>Sets the grid's origin corner, i.e. position (0, 0), to <em>c</em>.<h3 class=fn>void <a name="setRowStretch"></a>QGridLayout::setRowStretch ( int&nbsp;row, int&nbsp;stretch )<tt> [virtual]</tt></h3>Sets the <a href="layout.html#stretch-factor">stretch factor</a> of row <em>row</em> to <em>stretch</em>. The first rowis number 0.<p> The stretch factor is relative to the other rows in this grid.Rows with a higher stretch factor take more of the availablespace.<p> The default stretch factor is 0. If the stretch factor is 0 and noother row in this table can grow at all, the row may still grow.<p> <p>See also <a href="#rowStretch">rowStretch</a>(), <a href="#addRowSpacing">addRowSpacing</a>() and <a href="#setColStretch">setColStretch</a>().<p>Example: <a href="addressbook-example.html#x528">addressbook/centralwidget.cpp</a>.<h3 class=fn><a href="qsize.html">QSize</a> <a name="sizeHint"></a>QGridLayout::sizeHint () const<tt> [virtual]</tt></h3>Returns the preferred size of this grid.<p>Reimplemented from <a href="qlayoutitem.html#sizeHint">QLayoutItem</a>.<!-- eof --><hr><p>This file is part of the <a href="index.html">Qt toolkit</a>.Copyright &copy; 1995-2002<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center><table width=100% cellspacing=0 border=0><tr><td>Copyright &copy; 2002 <a href="http://www.trolltech.com">Trolltech</a><td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a><td align=right><div align=right>Qt version 3.0.5</div></table></div></address></body></html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?