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
|
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QFormLayout Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">  </td><td class="postheader" valign="center"><a href="../pyqt4ref.html"><font color="#004faf">Home</font></a> · <a href="classes.html"><font color="#004faf">All Classes</font></a> · <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QFormLayout Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QFormLayout class manages forms of input widgets and their associated labels. <a href="#details">More...</a></p>
<p>Inherits <a href="qlayout.html">QLayout</a>.</p><h3>Types</h3><ul><li><div class="fn" />enum <b><a href="qformlayout.html#FieldGrowthPolicy-enum">FieldGrowthPolicy</a></b> { FieldsStayAtSizeHint, ExpandingFieldsGrow, AllNonFixedFieldsGrow }</li><li><div class="fn" />enum <b><a href="qformlayout.html#ItemRole-enum">ItemRole</a></b> { LabelRole, FieldRole, SpanningRole }</li><li><div class="fn" />enum <b><a href="qformlayout.html#RowWrapPolicy-enum">RowWrapPolicy</a></b> { DontWrapRows, WrapLongRows, WrapAllRows }</li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qformlayout.html#QFormLayout">__init__</a></b> (<i>self</i>, QWidget <i>parent</i> = None)</li><li><div class="fn" /><b><a href="qformlayout.html#addItem">addItem</a></b> (<i>self</i>, QLayoutItem)</li><li><div class="fn" /><b><a href="qformlayout.html#addRow">addRow</a></b> (<i>self</i>, QWidget, QWidget)</li><li><div class="fn" /><b><a href="qformlayout.html#addRow-2">addRow</a></b> (<i>self</i>, QWidget, QLayout)</li><li><div class="fn" /><b><a href="qformlayout.html#addRow-3">addRow</a></b> (<i>self</i>, QString, QWidget)</li><li><div class="fn" /><b><a href="qformlayout.html#addRow-4">addRow</a></b> (<i>self</i>, QString, QLayout)</li><li><div class="fn" /><b><a href="qformlayout.html#addRow-5">addRow</a></b> (<i>self</i>, QWidget)</li><li><div class="fn" /><b><a href="qformlayout.html#addRow-6">addRow</a></b> (<i>self</i>, QLayout)</li><li><div class="fn" />int <b><a href="qformlayout.html#count">count</a></b> (<i>self</i>)</li><li><div class="fn" />Qt.Orientations <b><a href="qformlayout.html#expandingDirections">expandingDirections</a></b> (<i>self</i>)</li><li><div class="fn" />FieldGrowthPolicy <b><a href="qformlayout.html#fieldGrowthPolicy">fieldGrowthPolicy</a></b> (<i>self</i>)</li><li><div class="fn" />Qt.Alignment <b><a href="qformlayout.html#formAlignment">formAlignment</a></b> (<i>self</i>)</li><li><div class="fn" />(int, ItemRole) <b><a href="qformlayout.html#getItemPosition">getItemPosition</a></b> (<i>self</i>, int)</li><li><div class="fn" />(int, ItemRole) <b><a href="qformlayout.html#getLayoutPosition">getLayoutPosition</a></b> (<i>self</i>, QLayout)</li><li><div class="fn" />(int, ItemRole) <b><a href="qformlayout.html#getWidgetPosition">getWidgetPosition</a></b> (<i>self</i>, QWidget)</li><li><div class="fn" />bool <b><a href="qformlayout.html#hasHeightForWidth">hasHeightForWidth</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qformlayout.html#heightForWidth">heightForWidth</a></b> (<i>self</i>, int)</li><li><div class="fn" />int <b><a href="qformlayout.html#horizontalSpacing">horizontalSpacing</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qformlayout.html#insertRow">insertRow</a></b> (<i>self</i>, int, QWidget, QWidget)</li><li><div class="fn" /><b><a href="qformlayout.html#insertRow-2">insertRow</a></b> (<i>self</i>, int, QWidget, QLayout)</li><li><div class="fn" /><b><a href="qformlayout.html#insertRow-3">insertRow</a></b> (<i>self</i>, int, QString, QWidget)</li><li><div class="fn" /><b><a href="qformlayout.html#insertRow-4">insertRow</a></b> (<i>self</i>, int, QString, QLayout)</li><li><div class="fn" /><b><a href="qformlayout.html#insertRow-5">insertRow</a></b> (<i>self</i>, int, QWidget)</li><li><div class="fn" /><b><a href="qformlayout.html#insertRow-6">insertRow</a></b> (<i>self</i>, int, QLayout)</li><li><div class="fn" /><b><a href="qformlayout.html#invalidate">invalidate</a></b> (<i>self</i>)</li><li><div class="fn" />QLayoutItem <b><a href="qformlayout.html#itemAt">itemAt</a></b> (<i>self</i>, int, ItemRole)</li><li><div class="fn" />QLayoutItem <b><a href="qformlayout.html#itemAt-2">itemAt</a></b> (<i>self</i>, int)</li><li><div class="fn" />Qt.Alignment <b><a href="qformlayout.html#labelAlignment">labelAlignment</a></b> (<i>self</i>)</li><li><div class="fn" />QWidget <b><a href="qformlayout.html#labelForField">labelForField</a></b> (<i>self</i>, QWidget)</li><li><div class="fn" />QWidget <b><a href="qformlayout.html#labelForField-2">labelForField</a></b> (<i>self</i>, QLayout)</li><li><div class="fn" />QSize <b><a href="qformlayout.html#minimumSize">minimumSize</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qformlayout.html#rowCount">rowCount</a></b> (<i>self</i>)</li><li><div class="fn" />RowWrapPolicy <b><a href="qformlayout.html#rowWrapPolicy">rowWrapPolicy</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qformlayout.html#setFieldGrowthPolicy">setFieldGrowthPolicy</a></b> (<i>self</i>, FieldGrowthPolicy)</li><li><div class="fn" /><b><a href="qformlayout.html#setFormAlignment">setFormAlignment</a></b> (<i>self</i>, Qt.Alignment)</li><li><div class="fn" /><b><a href="qformlayout.html#setGeometry">setGeometry</a></b> (<i>self</i>, QRect)</li><li><div class="fn" /><b><a href="qformlayout.html#setHorizontalSpacing">setHorizontalSpacing</a></b> (<i>self</i>, int)</li><li><div class="fn" /><b><a href="qformlayout.html#setItem">setItem</a></b> (<i>self</i>, int, ItemRole, QLayoutItem)</li><li><div class="fn" /><b><a href="qformlayout.html#setLabelAlignment">setLabelAlignment</a></b> (<i>self</i>, Qt.Alignment)</li><li><div class="fn" /><b><a href="qformlayout.html#setLayout">setLayout</a></b> (<i>self</i>, int, ItemRole, QLayout)</li><li><div class="fn" /><b><a href="qformlayout.html#setRowWrapPolicy">setRowWrapPolicy</a></b> (<i>self</i>, RowWrapPolicy)</li><li><div class="fn" /><b><a href="qformlayout.html#setSpacing">setSpacing</a></b> (<i>self</i>, int)</li><li><div class="fn" /><b><a href="qformlayout.html#setVerticalSpacing">setVerticalSpacing</a></b> (<i>self</i>, int)</li><li><div class="fn" /><b><a href="qformlayout.html#setWidget">setWidget</a></b> (<i>self</i>, int, ItemRole, QWidget)</li><li><div class="fn" />QSize <b><a href="qformlayout.html#sizeHint">sizeHint</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qformlayout.html#spacing">spacing</a></b> (<i>self</i>)</li><li><div class="fn" />QLayoutItem <b><a href="qformlayout.html#takeAt">takeAt</a></b> (<i>self</i>, int)</li><li><div class="fn" />int <b><a href="qformlayout.html#verticalSpacing">verticalSpacing</a></b> (<i>self</i>)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QFormLayout class manages forms of input widgets and their associated labels.</p>
<p>QFormLayout is a convenience layout class that lays out its children in a two-column form. The left column consists of labels and the right column consists of "field" widgets (line editors, spin boxes, etc.).</p>
<p>Traditionally, such two-column form layouts were achieved using <a href="qgridlayout.html">QGridLayout</a>. QFormLayout is a higher-level alternative that provides the following advantages:</p>
<ul>
<li><b>Adherence to the different platform's look and feel guidelines.</b><p>For example, the <a href="http://developer.apple.com/documentation/UserExperience/Conceptual/AppleHIGuidelines/XHIGIntro/chapter_1_section_1.html">Mac OS X Aqua</a> and KDE guidelines specify that the labels should be right-aligned, whereas Windows and GNOME applications normally use left-alignment.</p>
</li>
<li><b>Support for wrapping long rows.</b><p>For devices with small displays, QFormLayout can be set to <a href="qformlayout.html#RowWrapPolicy-enum">wrap long rows</a>, or even to <a href="qformlayout.html#RowWrapPolicy-enum">wrap all rows</a>.</p>
</li>
<li><b>Convenient API for creating label--field pairs.</b><p>The <a href="qformlayout.html#addRow">addRow</a>() overload that takes a <a href="qstring.html">QString</a> and a <a href="qwidget.html">QWidget</a> * creates a <a href="qlabel.html">QLabel</a> behind the scenes and automatically set up its buddy. We can then write code like this:</p>
<pre> QFormLayout *formLayout = new QFormLayout;
formLayout->addRow(tr("&Name:"), nameLineEdit);
formLayout->addRow(tr("&Email:"), emailLineEdit);
formLayout->addRow(tr("&Age:"), ageSpinBox);
setLayout(formLayout);</pre>
<p>Compare this with the following code, written using <a href="qgridlayout.html">QGridLayout</a>:</p>
<pre> nameLabel = new QLabel(tr("&Name:"));
nameLabel->setBuddy(nameLineEdit);
emailLabel = new QLabel(tr("&Name:"));
emailLabel->setBuddy(emailLineEdit);
ageLabel = new QLabel(tr("&Name:"));
ageLabel->setBuddy(ageSpinBox);
QGridLayout *gridLayout = new QGridLayout;
gridLayout->addWidget(nameLabel, 0, 0);
gridLayout->addWidget(nameLineEdit, 0, 1);
gridLayout->addWidget(emailLabel, 1, 0);
gridLayout->addWidget(emailLineEdit, 1, 1);
gridLayout->addWidget(ageLabel, 2, 0);
gridLayout->addWidget(ageSpinBox, 2, 1);
setLayout(gridLayout);</pre>
</li>
</ul>
<p>The table below shows the default appearance in different styles.</p>
<p><table align="center" border="0" cellpadding="2" cellspacing="1" class="generic">
<thead><tr class="qt-style" valign="top"><th><a href="qcommonstyle.html">QCommonStyle</a> derived styles (except <a href="qplastiquestyle.html">QPlastiqueStyle</a>)</th><th><a href="qmacstyle.html">QMacStyle</a></th><th><a href="qplastiquestyle.html">QPlastiqueStyle</a></th><th>Qt Extended styles</th></tr></thead>
<tr class="odd" valign="top"><td><img src="images/qformlayout-win.png" /></td><td><img src="images/qformlayout-mac.png" /></td><td><img src="images/qformlayout-kde.png" /></td><td><img src="images/qformlayout-qpe.png" /></td></tr>
<tr class="even" valign="top"><td>Traditional style used for Windows, GNOME, and earlier versions of KDE. Labels are left aligned, and expanding fields grow to fill the available space. (This normally corresponds to what we would get using a two-column <a href="qgridlayout.html">QGridLayout</a>.)</td><td>Style based on the <a href="http://developer.apple.com/documentation/UserExperience/Conceptual/AppleHIGuidelines/XHIGIntro/chapter_1_section_1.html">Mac OS X Aqua</a> guidelines. Labels are right-aligned, the fields don't grow beyond their size hint, and the form is horizontally centered.</td><td>Recommended style for <a href="http://www.kdedevelopers.org/node/2345">KDE applications</a>. Similar to MacStyle, except that the form is left-aligned and all fields grow to fill the available space.</td><td>Default style for Qt Extended styles. Labels are right-aligned, expanding fields grow to fill the available space, and row wrapping is enabled for long lines.</td></tr>
</table></p>
<p>The form styles can be also be overridden individually by calling <a href="qformlayout.html#labelAlignment-prop">setLabelAlignment</a>(), <a href="qformlayout.html#formAlignment-prop">setFormAlignment</a>(), <a href="qformlayout.html#fieldGrowthPolicy-prop">setFieldGrowthPolicy</a>(), and <a href="qformlayout.html#rowWrapPolicy-prop">setRowWrapPolicy</a>(). For example, to simulate the form layout appearance of <a href="qmacstyle.html">QMacStyle</a> on all platforms, but with left-aligned labels, you could write:</p>
<pre> formLayout->setRowWrapPolicy(QFormLayout.DontWrapRows);
formLayout->setFieldGrowthPolicy(QFormLayout.FieldsStayAtSizeHint);
formLayout->setFormAlignment(Qt.AlignHCenter | Qt.AlignTop);
formLayout->setLabelAlignment(Qt.AlignLeft);</pre>
<p>See also <a href="qgridlayout.html">QGridLayout</a>, <a href="qboxlayout.html">QBoxLayout</a>, and <a href="qstackedlayout.html">QStackedLayout</a>.</p>
<hr /><h2>Type Documentation</h2><h3 class="fn"><a name="FieldGrowthPolicy-enum" />QFormLayout.FieldGrowthPolicy</h3><p>This enum specifies the different policies that can be used to control the way in which the form's fields grow.</p>
<p><table border="1" cellpadding="2" cellspacing="1" class="valuelist" width="100%">
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
<tr><td valign="top"><tt>QFormLayout.FieldsStayAtSizeHint</tt></td><td align="center" valign="top"><tt>0</tt></td><td valign="top">The fields never grow beyond their <a href="qwidgetitem.html#sizeHint">effective size hint</a>. This is the default for <a href="qmacstyle.html">QMacStyle</a>.</td></tr>
<tr><td valign="top"><tt>QFormLayout.ExpandingFieldsGrow</tt></td><td align="center" valign="top"><tt>1</tt></td><td valign="top">Fields with an horizontal <a href="qsizepolicy.html">size policy</a> of <a href="qsizepolicy.html#Policy-enum">Expanding</a> or <a href="qsizepolicy.html#Policy-enum">MinimumExpanding</a> will grow to fill the available space. The other fields will not grow beyond their effective size hint. This is the default policy for Plastique.</td></tr>
<tr><td valign="top"><tt>QFormLayout.AllNonFixedFieldsGrow</tt></td><td align="center" valign="top"><tt>2</tt></td><td valign="top">All fields with a size policy that allows them to grow will grow to fill the available space. This is the default policy for most styles.</td></tr>
</table></p>
<p>See also <a href="qformlayout.html#fieldGrowthPolicy-prop">fieldGrowthPolicy</a>.</p>
<a name="//apple_ref/cpp/tag/QFormLayout/ItemRole" />
<a name="//apple_ref/cpp/econst/QFormLayout/LabelRole" />
<a name="//apple_ref/cpp/econst/QFormLayout/FieldRole" />
<a name="//apple_ref/cpp/econst/QFormLayout/SpanningRole" />
<h3 class="fn"><a name="ItemRole-enum" />QFormLayout.ItemRole</h3><p>This enum specifies the types of widgets (or other layout items) that may appear in a row.</p>
<p><table border="1" cellpadding="2" cellspacing="1" class="valuelist" width="100%">
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
<tr><td valign="top"><tt>QFormLayout.LabelRole</tt></td><td align="center" valign="top"><tt>0</tt></td><td valign="top">A label widget.</td></tr>
<tr><td valign="top"><tt>QFormLayout.FieldRole</tt></td><td align="center" valign="top"><tt>1</tt></td><td valign="top">A field widget.</td></tr>
<tr><td valign="top"><tt>QFormLayout.SpanningRole</tt></td><td align="center" valign="top"><tt>2</tt></td><td valign="top">A widget that spans label and field columns.</td></tr>
</table></p>
<p>See also <a href="qformlayout.html#itemAt">itemAt</a>() and <a href="qformlayout.html#getItemPosition">getItemPosition</a>().</p>
<a name="//apple_ref/cpp/tag/QFormLayout/RowWrapPolicy" />
<a name="//apple_ref/cpp/econst/QFormLayout/DontWrapRows" />
<a name="//apple_ref/cpp/econst/QFormLayout/WrapLongRows" />
<a name="//apple_ref/cpp/econst/QFormLayout/WrapAllRows" />
<h3 class="fn"><a name="RowWrapPolicy-enum" />QFormLayout.RowWrapPolicy</h3><p>This enum specifies the different policies that can be used to control the way in which the form's rows wrap.</p>
<p><table border="1" cellpadding="2" cellspacing="1" class="valuelist" width="100%">
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
<tr><td valign="top"><tt>QFormLayout.DontWrapRows</tt></td><td align="center" valign="top"><tt>0</tt></td><td valign="top">Fields are always laid out next to their label. This is the default policy for all styles except Qt Extended styles and <a href="qs60style.html">QS60Style</a>.</td></tr>
<tr><td valign="top"><tt>QFormLayout.WrapLongRows</tt></td><td align="center" valign="top"><tt>1</tt></td><td valign="top">Labels are given enough horizontal space to fit the widest label, and the rest of the space is given to the fields. If the minimum size of a field pair is wider than the available space, the field is wrapped to the next line. This is the default policy for Qt Extended styles and and <a href="qs60style.html">QS60Style</a>.</td></tr>
<tr><td valign="top"><tt>QFormLayout.WrapAllRows</tt></td><td align="center" valign="top"><tt>2</tt></td><td valign="top">Fields are always laid out below their label.</td></tr>
</table></p>
<p>See also <a href="qformlayout.html#rowWrapPolicy-prop">rowWrapPolicy</a>.</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QFormLayout" />QFormLayout.__init__ (<i>self</i>, <a href="qwidget.html">QWidget</a> <i>parent</i> = None)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs a new form layout with the given <i>parent</i> widget.</p>
<p>See also <a href="qwidget.html#setLayout">QWidget.setLayout</a>().</p>
<a name="//apple_ref/cpp/instm/QFormLayout/~QFormLayout" />
<h3 class="fn"><a name="addItem" />QFormLayout.addItem (<i>self</i>, <a href="qlayoutitem.html">QLayoutItem</a>)</h3><p>The <i>QLayoutItem</i> argument has it's ownership transferred to Qt.</p><p>Reimplemented from <a href="qlayout.html#addItem">QLayout.addItem</a>().</p>
<a name="//apple_ref/cpp/instm/QFormLayout/addRow" />
<h3 class="fn"><a name="addRow" />QFormLayout.addRow (<i>self</i>, <a href="qwidget.html">QWidget</a>, <a href="qwidget.html">QWidget</a>)</h3><p>The <i>QWidget</i> argument has it's ownership transferred to Qt.</p><p>The <i>QWidget</i> argument has it's ownership transferred to Qt.</p><p>Adds a new row to the bottom of this form layout, with the given <i>label</i> and <i>field</i>.</p>
<p>See also <a href="qformlayout.html#insertRow">insertRow</a>().</p>
<h3 class="fn"><a name="addRow-2" />QFormLayout.addRow (<i>self</i>, <a href="qwidget.html">QWidget</a>, <a href="qlayout.html">QLayout</a>)</h3><p>The <i>QWidget</i> argument has it's ownership transferred to Qt.</p><p>The <i>QLayout</i> argument has it's ownership transferred to Qt.</p><p>This is an overloaded function.</p>
<h3 class="fn"><a name="addRow-3" />QFormLayout.addRow (<i>self</i>, QString, <a href="qwidget.html">QWidget</a>)</h3><p>The <i>QWidget</i> argument has it's ownership transferred to Qt.</p><p>This is an overloaded function.</p>
<p>This overload automatically creates a <a href="qlabel.html">QLabel</a> behind the scenes with <i>labelText</i> as its text. The <i>field</i> is set as the new <a href="qlabel.html">QLabel</a>'s <a href="qlabel.html#setBuddy">buddy</a>.</p>
<h3 class="fn"><a name="addRow-4" />QFormLayout.addRow (<i>self</i>, QString, <a href="qlayout.html">QLayout</a>)</h3><p>The <i>QLayout</i> argument has it's ownership transferred to Qt.</p><p>This is an overloaded function.</p>
<p>This overload automatically creates a <a href="qlabel.html">QLabel</a> behind the scenes with <i>labelText</i> as its text.</p>
<h3 class="fn"><a name="addRow-5" />QFormLayout.addRow (<i>self</i>, <a href="qwidget.html">QWidget</a>)</h3><p>The <i>QWidget</i> argument has it's ownership transferred to Qt.</p><p>This is an overloaded function.</p>
<p>Adds the specified <i>widget</i> at the end of this form layout. The <i>widget</i> spans both columns.</p>
<h3 class="fn"><a name="addRow-6" />QFormLayout.addRow (<i>self</i>, <a href="qlayout.html">QLayout</a>)</h3><p>The <i>QLayout</i> argument has it's ownership transferred to Qt.</p><p>This is an overloaded function.</p>
<p>Adds the specified <i>layout</i> at the end of this form layout. The <i>layout</i> spans both columns.</p>
<a name="//apple_ref/cpp/instm/QFormLayout/count" />
<h3 class="fn"><a name="count" />int QFormLayout.count (<i>self</i>)</h3><p>Reimplemented from <a href="qlayout.html#count">QLayout.count</a>().</p>
<a name="//apple_ref/cpp/instm/QFormLayout/expandingDirections" />
<h3 class="fn"><a name="expandingDirections" /><a href="qt-orientations.html">Qt.Orientations</a> QFormLayout.expandingDirections (<i>self</i>)</h3><p>Reimplemented from <a href="qlayoutitem.html#expandingDirections">QLayoutItem.expandingDirections</a>().</p>
<a name="//apple_ref/cpp/instm/QFormLayout/getItemPosition" />
<h3 class="fn"><a name="fieldGrowthPolicy" /><a href="qformlayout.html#FieldGrowthPolicy-enum">FieldGrowthPolicy</a> QFormLayout.fieldGrowthPolicy (<i>self</i>)</h3><h3 class="fn"><a name="formAlignment" /><a href="qt-alignment.html">Qt.Alignment</a> QFormLayout.formAlignment (<i>self</i>)</h3><h3 class="fn"><a name="getItemPosition" />(int, <a href="qformlayout.html#ItemRole-enum">ItemRole</a>) QFormLayout.getItemPosition (<i>self</i>, int)</h3><p>Retrieves the row and role (column) of the item at the specified <i>index</i>. If <i>index</i> is out of bounds, *<i>rowPtr</i> is set to -1; otherwise the row is stored in *<i>rowPtr</i> and the role is stored in *<i>rolePtr</i>.</p>
<p>See also <a href="qformlayout.html#itemAt">itemAt</a>(), <a href="qformlayout.html#count">count</a>(), <a href="qformlayout.html#getLayoutPosition">getLayoutPosition</a>(), and <a href="qformlayout.html#getWidgetPosition">getWidgetPosition</a>().</p>
<a name="//apple_ref/cpp/instm/QFormLayout/getLayoutPosition" />
<h3 class="fn"><a name="getLayoutPosition" />(int, <a href="qformlayout.html#ItemRole-enum">ItemRole</a>) QFormLayout.getLayoutPosition (<i>self</i>, <a href="qlayout.html">QLayout</a>)</h3><p>Retrieves the row and role (column) of the specified child <i>layout</i>. If <i>layout</i> is not in the form layout, *<i>rowPtr</i> is set to -1; otherwise the row is stored in *<i>rowPtr</i> and the role is stored in *<i>rolePtr</i>.</p>
<a name="//apple_ref/cpp/instm/QFormLayout/getWidgetPosition" />
<h3 class="fn"><a name="getWidgetPosition" />(int, <a href="qformlayout.html#ItemRole-enum">ItemRole</a>) QFormLayout.getWidgetPosition (<i>self</i>, <a href="qwidget.html">QWidget</a>)</h3><p>Retrieves the row and role (column) of the specified <i>widget</i> in the layout. If <i>widget</i> is not in the layout, *<i>rowPtr</i> is set to -1; otherwise the row is stored in *<i>rowPtr</i> and the role is stored in *<i>rolePtr</i>.</p>
<p>See also <a href="qformlayout.html#getItemPosition">getItemPosition</a>() and <a href="qformlayout.html#itemAt">itemAt</a>().</p>
<a name="//apple_ref/cpp/instm/QFormLayout/hasHeightForWidth" />
<h3 class="fn"><a name="hasHeightForWidth" />bool QFormLayout.hasHeightForWidth (<i>self</i>)</h3><p>Reimplemented from <a href="qlayoutitem.html#hasHeightForWidth">QLayoutItem.hasHeightForWidth</a>().</p>
<a name="//apple_ref/cpp/instm/QFormLayout/heightForWidth" />
<h3 class="fn"><a name="heightForWidth" />int QFormLayout.heightForWidth (<i>self</i>, int)</h3><p>Reimplemented from <a href="qlayoutitem.html#heightForWidth">QLayoutItem.heightForWidth</a>().</p>
<a name="//apple_ref/cpp/instm/QFormLayout/insertRow" />
<h3 class="fn"><a name="horizontalSpacing" />int QFormLayout.horizontalSpacing (<i>self</i>)</h3><h3 class="fn"><a name="insertRow" />QFormLayout.insertRow (<i>self</i>, int, <a href="qwidget.html">QWidget</a>, <a href="qwidget.html">QWidget</a>)</h3><p>The <i>QWidget</i> argument has it's ownership transferred to Qt.</p><p>The <i>QWidget</i> argument has it's ownership transferred to Qt.</p><p>Inserts a new row at position <i>row</i> in this form layout, with the given <i>label</i> and <i>field</i>. If <i>row</i> is out of bounds, the new row is added at the end.</p>
<p>See also <a href="qformlayout.html#addRow">addRow</a>().</p>
<h3 class="fn"><a name="insertRow-2" />QFormLayout.insertRow (<i>self</i>, int, <a href="qwidget.html">QWidget</a>, <a href="qlayout.html">QLayout</a>)</h3><p>The <i>QWidget</i> argument has it's ownership transferred to Qt.</p><p>The <i>QLayout</i> argument has it's ownership transferred to Qt.</p><p>This is an overloaded function.</p>
<h3 class="fn"><a name="insertRow-3" />QFormLayout.insertRow (<i>self</i>, int, QString, <a href="qwidget.html">QWidget</a>)</h3><p>The <i>QWidget</i> argument has it's ownership transferred to Qt.</p><p>This is an overloaded function.</p>
<p>This overload automatically creates a <a href="qlabel.html">QLabel</a> behind the scenes with <i>labelText</i> as its text. The <i>field</i> is set as the new <a href="qlabel.html">QLabel</a>'s <a href="qlabel.html#setBuddy">buddy</a>.</p>
<h3 class="fn"><a name="insertRow-4" />QFormLayout.insertRow (<i>self</i>, int, QString, <a href="qlayout.html">QLayout</a>)</h3><p>The <i>QLayout</i> argument has it's ownership transferred to Qt.</p><p>This is an overloaded function.</p>
<p>This overload automatically creates a <a href="qlabel.html">QLabel</a> behind the scenes with <i>labelText</i> as its text.</p>
<h3 class="fn"><a name="insertRow-5" />QFormLayout.insertRow (<i>self</i>, int, <a href="qwidget.html">QWidget</a>)</h3><p>The <i>QWidget</i> argument has it's ownership transferred to Qt.</p><p>This is an overloaded function.</p>
<p>Inserts the specified <i>widget</i> at position <i>row</i> in this form layout. The <i>widget</i> spans both columns. If <i>row</i> is out of bounds, the widget is added at the end.</p>
<h3 class="fn"><a name="insertRow-6" />QFormLayout.insertRow (<i>self</i>, int, <a href="qlayout.html">QLayout</a>)</h3><p>The <i>QLayout</i> argument has it's ownership transferred to Qt.</p><p>This is an overloaded function.</p>
<p>Inserts the specified <i>layout</i> at position <i>row</i> in this form layout. The <i>layout</i> spans both columns. If <i>row</i> is out of bounds, the widget is added at the end.</p>
<a name="//apple_ref/cpp/instm/QFormLayout/invalidate" />
<h3 class="fn"><a name="invalidate" />QFormLayout.invalidate (<i>self</i>)</h3><p>Reimplemented from <a href="qlayoutitem.html#invalidate">QLayoutItem.invalidate</a>().</p>
<a name="//apple_ref/cpp/instm/QFormLayout/itemAt" />
<h3 class="fn"><a name="itemAt" /><a href="qlayoutitem.html">QLayoutItem</a> QFormLayout.itemAt (<i>self</i>, int, <a href="qformlayout.html#ItemRole-enum">ItemRole</a>)</h3><p>Returns the layout item in the given <i>row</i> with the specified <i>role</i> (column). Returns 0 if there is no such item.</p>
<p>See also <a href="qlayout.html#itemAt">QLayout.itemAt</a>() and <a href="qformlayout.html#setItem">setItem</a>().</p>
<h3 class="fn"><a name="itemAt-2" /><a href="qlayoutitem.html">QLayoutItem</a> QFormLayout.itemAt (<i>self</i>, int)</h3><p>Reimplemented from <a href="qlayout.html#itemAt">QLayout.itemAt</a>().</p>
<a name="//apple_ref/cpp/instm/QFormLayout/labelForField" />
<h3 class="fn"><a name="labelAlignment" /><a href="qt-alignment.html">Qt.Alignment</a> QFormLayout.labelAlignment (<i>self</i>)</h3><h3 class="fn"><a name="labelForField" /><a href="qwidget.html">QWidget</a> QFormLayout.labelForField (<i>self</i>, <a href="qwidget.html">QWidget</a>)</h3><p>Returns the label associated with the given <i>field</i>.</p>
<p>See also <a href="qformlayout.html#itemAt">itemAt</a>().</p>
<h3 class="fn"><a name="labelForField-2" /><a href="qwidget.html">QWidget</a> QFormLayout.labelForField (<i>self</i>, <a href="qlayout.html">QLayout</a>)</h3><p>This is an overloaded function.</p>
<a name="//apple_ref/cpp/instm/QFormLayout/minimumSize" />
<h3 class="fn"><a name="minimumSize" /><a href="qsize.html">QSize</a> QFormLayout.minimumSize (<i>self</i>)</h3><p>Reimplemented from <a href="qlayoutitem.html#minimumSize">QLayoutItem.minimumSize</a>().</p>
<a name="//apple_ref/cpp/instm/QFormLayout/rowCount" />
<h3 class="fn"><a name="rowCount" />int QFormLayout.rowCount (<i>self</i>)</h3><p>Returns the number of rows in the form.</p>
<p>See also <a href="qlayout.html#count">QLayout.count</a>().</p>
<a name="//apple_ref/cpp/instm/QFormLayout/setGeometry" />
<h3 class="fn"><a name="rowWrapPolicy" /><a href="qformlayout.html#RowWrapPolicy-enum">RowWrapPolicy</a> QFormLayout.rowWrapPolicy (<i>self</i>)</h3><h3 class="fn"><a name="setFieldGrowthPolicy" />QFormLayout.setFieldGrowthPolicy (<i>self</i>, <a href="qformlayout.html#FieldGrowthPolicy-enum">FieldGrowthPolicy</a>)</h3><h3 class="fn"><a name="setFormAlignment" />QFormLayout.setFormAlignment (<i>self</i>, <a href="qt-alignment.html">Qt.Alignment</a>)</h3><h3 class="fn"><a name="setGeometry" />QFormLayout.setGeometry (<i>self</i>, <a href="qrect.html">QRect</a>)</h3><p>Reimplemented from <a href="qlayoutitem.html#setGeometry">QLayoutItem.setGeometry</a>().</p>
<a name="//apple_ref/cpp/instm/QFormLayout/setItem" />
<h3 class="fn"><a name="setHorizontalSpacing" />QFormLayout.setHorizontalSpacing (<i>self</i>, int)</h3><h3 class="fn"><a name="setItem" />QFormLayout.setItem (<i>self</i>, int, <a href="qformlayout.html#ItemRole-enum">ItemRole</a>, <a href="qlayoutitem.html">QLayoutItem</a>)</h3><p>The <i>QLayoutItem</i> argument has it's ownership transferred to Qt.</p><p>Sets the item in the given <i>row</i> for the given <i>role</i> to <i>item</i>, extending the layout with empty rows if necessary.</p>
<p>If the cell is already occupied, the <i>item</i> is not inserted and an error message is sent to the console. The <i>item</i> spans both columns.</p>
<p><b>Warning:</b> Do not use this function to add child layouts or child widget items. Use <a href="qformlayout.html#setLayout">setLayout</a>() or <a href="qformlayout.html#setWidget">setWidget</a>() instead.</p>
<p>See also <a href="qformlayout.html#setLayout">setLayout</a>().</p>
<a name="//apple_ref/cpp/instm/QFormLayout/setLayout" />
<h3 class="fn"><a name="setLabelAlignment" />QFormLayout.setLabelAlignment (<i>self</i>, <a href="qt-alignment.html">Qt.Alignment</a>)</h3><h3 class="fn"><a name="setLayout" />QFormLayout.setLayout (<i>self</i>, int, <a href="qformlayout.html#ItemRole-enum">ItemRole</a>, <a href="qlayout.html">QLayout</a>)</h3><p>The <i>QLayout</i> argument has it's ownership transferred to Qt.</p><p>Sets the sub-layout in the given <i>row</i> for the given <i>role</i> to <i>layout</i>, extending the form layout with empty rows if necessary.</p>
<p>If the cell is already occupied, the <i>layout</i> is not inserted and an error message is sent to the console.</p>
<p><b>Note:</b> For most applications, <a href="qformlayout.html#addRow">addRow</a>() or <a href="qformlayout.html#insertRow">insertRow</a>() should be used instead of setLayout().</p>
<p>See also <a href="qformlayout.html#setWidget">setWidget</a>().</p>
<a name="//apple_ref/cpp/instm/QFormLayout/setSpacing" />
<h3 class="fn"><a name="setRowWrapPolicy" />QFormLayout.setRowWrapPolicy (<i>self</i>, <a href="qformlayout.html#RowWrapPolicy-enum">RowWrapPolicy</a>)</h3><h3 class="fn"><a name="setSpacing" />QFormLayout.setSpacing (<i>self</i>, int)</h3><p>This function sets both the vertical and horizontal spacing to <i>spacing</i>.</p>
<p>See also <a href="qformlayout.html#spacing">spacing</a>(), <a href="qformlayout.html#verticalSpacing-prop">setVerticalSpacing</a>(), and <a href="qformlayout.html#horizontalSpacing-prop">setHorizontalSpacing</a>().</p>
<a name="//apple_ref/cpp/instm/QFormLayout/setWidget" />
<h3 class="fn"><a name="setVerticalSpacing" />QFormLayout.setVerticalSpacing (<i>self</i>, int)</h3><h3 class="fn"><a name="setWidget" />QFormLayout.setWidget (<i>self</i>, int, <a href="qformlayout.html#ItemRole-enum">ItemRole</a>, <a href="qwidget.html">QWidget</a>)</h3><p>The <i>QWidget</i> argument has it's ownership transferred to Qt.</p><p>Sets the widget in the given <i>row</i> for the given <i>role</i> to <i>widget</i>, extending the layout with empty rows if necessary.</p>
<p>If the cell is already occupied, the <i>widget</i> is not inserted and an error message is sent to the console.</p>
<p><b>Note:</b> For most applications, <a href="qformlayout.html#addRow">addRow</a>() or <a href="qformlayout.html#insertRow">insertRow</a>() should be used instead of setWidget().</p>
<p>See also <a href="qformlayout.html#setLayout">setLayout</a>().</p>
<a name="//apple_ref/cpp/instm/QFormLayout/sizeHint" />
<h3 class="fn"><a name="sizeHint" /><a href="qsize.html">QSize</a> QFormLayout.sizeHint (<i>self</i>)</h3><p>Reimplemented from <a href="qlayoutitem.html#sizeHint">QLayoutItem.sizeHint</a>().</p>
<a name="//apple_ref/cpp/instm/QFormLayout/spacing" />
<h3 class="fn"><a name="spacing" />int QFormLayout.spacing (<i>self</i>)</h3><p>If the vertical spacing is equal to the horizontal spacing, this function returns that value; otherwise it returns -1.</p>
<p>See also <a href="qformlayout.html#setSpacing">setSpacing</a>(), <a href="qformlayout.html#verticalSpacing-prop">verticalSpacing</a>(), and <a href="qformlayout.html#horizontalSpacing-prop">horizontalSpacing</a>().</p>
<a name="//apple_ref/cpp/instm/QFormLayout/takeAt" />
<h3 class="fn"><a name="takeAt" /><a href="qlayoutitem.html">QLayoutItem</a> QFormLayout.takeAt (<i>self</i>, int)</h3><p>The <i>QLayoutItem</i> result</p><p>Reimplemented from <a href="qlayout.html#takeAt">QLayout.takeAt</a>().</p>
<p /><h3 class="fn"><a name="verticalSpacing" />int QFormLayout.verticalSpacing (<i>self</i>)</h3><address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt 4.7.3 for X11</td><td align="center" width="50%">Copyright © <a href="http://www.riverbankcomputing.com">Riverbank Computing Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2010</td><td align="right" width="25%">Qt 4.6.2</td></tr></table></div></address></body></html>
|