Qyoto  4.0.5
Qyoto is a C# language binding for Qt
 All Classes Namespaces Functions Variables Typedefs Enumerations Properties
QtGui.QFormLayout Class Reference

The QFormLayout class manages forms of input widgets and their associated labels. More...

Inheritance diagram for QtGui.QFormLayout:
Collaboration diagram for QtGui.QFormLayout:

Public Types

enum  FieldGrowthPolicy { AllNonFixedFieldsGrow = 2, ExpandingFieldsGrow = 1, FieldsStayAtSizeHint = 0 }
  More...
 
enum  ItemRole { FieldRole = 1, LabelRole = 0, SpanningRole = 2 }
  More...
 
enum  RowWrapPolicy { DontWrapRows = 0, WrapAllRows = 2, WrapLongRows = 1 }
  More...
 
- Public Types inherited from QtGui.QLayout
enum  SizeConstraint {
  SetDefaultConstraint = 0, SetFixedSize = 3, SetMaximumSize = 4, SetMinAndMaxSize = 5,
  SetMinimumSize = 2, SetNoConstraint = 1
}
  More...
 

Public Member Functions

 QFormLayout (QWidget parent=null)
 
 
override void CreateProxy ()
 
override void AddItem (IQLayoutItem item)
 
 
new void AddRow (QWidget widget)
 
 
new void AddRow (QLayout layout)
 
 
new void AddRow (QWidget label, QWidget field)
 
 
new void AddRow (QWidget label, QLayout field)
 
 
new void AddRow (string labelText, QWidget field)
 
 
new void AddRow (string labelText, QLayout field)
 
 
override int Count ()
 
 
override Qt.Orientation ExpandingDirections ()
 
 
new Qt.AlignmentFlag formAlignment ()
 
new void GetItemPosition (int index, ref int rowPtr, QFormLayout.ItemRole rolePtr)
 
 
new void GetLayoutPosition (QLayout layout, ref int rowPtr, QFormLayout.ItemRole rolePtr)
 
 
new void GetWidgetPosition (QWidget widget, ref int rowPtr, QFormLayout.ItemRole rolePtr)
 
 
override bool HasHeightForWidth ()
 
 
override int HeightForWidth (int width)
 
 
new void InsertRow (int row, QWidget widget)
 
 
new void InsertRow (int row, QLayout layout)
 
 
new void InsertRow (int row, QWidget label, QWidget field)
 
 
new void InsertRow (int row, QWidget label, QLayout field)
 
 
new void InsertRow (int row, string labelText, QWidget field)
 
 
new void InsertRow (int row, string labelText, QLayout field)
 
 
override void Invalidate ()
 
 
override IQLayoutItem ItemAt (int index)
 
 
new IQLayoutItem ItemAt (int row, QFormLayout.ItemRole role)
 
 
new Qt.AlignmentFlag labelAlignment ()
 
new QWidget LabelForField (QWidget field)
 
 
new QWidget LabelForField (QLayout field)
 
 
override QSize MinimumSize ()
 
 
new int RowCount ()
 
 
new void SetFormAlignment (Qt.AlignmentFlag alignment)
 
new void SetItem (int row, QFormLayout.ItemRole role, IQLayoutItem item)
 
 
new void SetLabelAlignment (Qt.AlignmentFlag alignment)
 
new void SetLayout (int row, QFormLayout.ItemRole role, QLayout layout)
 
 
new void SetWidget (int row, QFormLayout.ItemRole role, QWidget widget)
 
 
override QSize SizeHint ()
 
 
override IQLayoutItem TakeAt (int index)
 
 
new void Dispose ()
 
- Public Member Functions inherited from QtGui.QLayout
 QLayout ()
 
 
 QLayout (QWidget parent)
 
 
override void CreateProxy ()
 
new bool Activate ()
 
 
new void AddWidget (QWidget w)
 
 
new QRect ContentsRect ()
 
 
new void GetContentsMargins (ref int left, ref int top, ref int right, ref int bottom)
 
 
virtual int IndexOf (QWidget arg1)
 
 
virtual bool IsEmpty ()
 
 
new bool IsEnabled ()
 
 
virtual QLayout Layout ()
 
 
virtual QSize MaximumSize ()
 
 
new QWidget ParentWidget ()
 
 
new void RemoveItem (IQLayoutItem arg1)
 
 
new void RemoveWidget (QWidget w)
 
 
new bool SetAlignment (QWidget w, Qt.AlignmentFlag alignment)
 
 
new bool SetAlignment (QLayout l, Qt.AlignmentFlag alignment)
 
 
new void SetContentsMargins (int left, int top, int right, int bottom)
 
 
new void SetEnabled (bool arg1)
 
 
new int TotalHeightForWidth (int w)
 
new QSize TotalMaximumSize ()
 
new QSize TotalMinimumSize ()
 
new QSize TotalSizeHint ()
 
new void Update ()
 
 
new void Dispose ()
 
new QSizePolicy.ControlType ControlTypes ()
 
virtual int MinimumHeightForWidth (int arg1)
 
virtual QSpacerItem SpacerItem ()
 
virtual QWidget Widget ()
 
- Public Member Functions inherited from QtCore.QObject
 QObject (QObject parent=null)
 
 
new bool BlockSignals (bool b)
 
 
new
System.Collections.Generic.List
< QObject
Children ()
 
 
new bool Connect (QObject sender, string signal, string member, Qt.ConnectionType type=Qt.ConnectionType.AutoConnection)
 
 
new void DeleteLater ()
 
 
new bool Disconnect (QObject receiver, string member=null)
 
 
new bool Disconnect (string signal=null, QObject receiver=null, string member=null)
 
 
new void DumpObjectInfo ()
 
 
new void DumpObjectTree ()
 
 
new
System.Collections.Generic.List
< QByteArray
DynamicPropertyNames ()
 
 
virtual bool OnEvent (QEvent arg1)
 
 
virtual bool EventFilter (QObject arg1, QEvent arg2)
 
 
new bool Inherits (string classname)
 
 
new void InstallEventFilter (QObject arg1)
 
 
new bool IsWidgetType ()
 
 
new void KillTimer (int id)
 
 
new object Property (string name)
 
 
new void RemoveEventFilter (QObject arg1)
 
 
new bool SetProperty (string name, object value)
 
 
new void SetUserData (uint id, QObjectUserData data)
 
new bool SignalsBlocked ()
 
 
new int StartTimer (int interval)
 
 
new QObjectUserData UserData (uint id)
 
new void Dispose ()
 
- Public Member Functions inherited from QtCore.Qt
delegate QTextStream FuncQTextStreamQTextStream (QTextStream qTextStream)
 
delegate string FuncStringQByteArray (QByteArray qByteArray)
 
delegate QByteArray FuncQByteArrayString (string @string)
 
delegate void ActionQtMsgTypeString (QtMsgType qtMsgType, string @string)
 
delegate QObject FuncQObject ()
 
- Public Member Functions inherited from QtGui.IQLayoutItem
new QSizePolicy.ControlType ControlTypes ()
 
Qt.Orientation ExpandingDirections ()
 
bool HasHeightForWidth ()
 
int HeightForWidth (int arg1)
 
void Invalidate ()
 
bool IsEmpty ()
 
QLayout Layout ()
 
QSize MaximumSize ()
 
int MinimumHeightForWidth (int arg1)
 
QSize MinimumSize ()
 
QSize SizeHint ()
 
QSpacerItem SpacerItem ()
 
QWidget Widget ()
 

Static Public Member Functions

static string Tr (string s, string c=null)
 
static string Tr (string s, string c, int n)
 
static string TrUtf8 (string s, string c=null)
 
static string TrUtf8 (string s, string c, int n)
 
- Static Public Member Functions inherited from QtGui.QLayout
static QSize ClosestAcceptableSize (QWidget w, QSize s)
 
 
static string Tr (string s, string c=null)
 
static string Tr (string s, string c, int n)
 
static string TrUtf8 (string s, string c=null)
 
static string TrUtf8 (string s, string c, int n)
 
- Static Public Member Functions inherited from QtCore.QObject
static bool Connect (QObject sender, QMetaMethod signal, QObject receiver, QMetaMethod method, Qt.ConnectionType type=Qt.ConnectionType.AutoConnection)
 
 
static bool Connect (QObject sender, string signal, QObject receiver, string member, Qt.ConnectionType arg5=Qt.ConnectionType.AutoConnection)
 
 
static bool Disconnect (QObject sender, QMetaMethod signal, QObject receiver, QMetaMethod member)
 
 
static bool Disconnect (QObject sender, string signal, QObject receiver, string member)
 
 
static uint RegisterUserData ()
 
static string Tr (string s, string c=null)
 
 
static string Tr (string s, string c, int n)
 
 
static string TrUtf8 (string s, string c=null)
 
 
static string TrUtf8 (string s, string c, int n)
 
 
- Static Public Member Functions inherited from QtCore.Qt
static QDataStream Write (QDataStream s, object p)
 
static QDataStream Write (QDataStream arg1, QSizeF arg2)
 
static QTextStream Write (QTextStream s, Qt.FuncQTextStreamQTextStream f)
 
static QDataStream Write (QDataStream arg1, QPoint arg2)
 
static QDataStream Write (QDataStream arg1, QLineF arg2)
 
static QDataStream Write (QDataStream arg1, QPointF arg2)
 
static QDataStream Write (QDataStream arg1, QChar arg2)
 
static QDataStream Write (QDataStream arg1, QByteArray arg2)
 
static QDataStream Write (QDataStream arg1, QEasingCurve arg2)
 
static QDataStream Write (QDataStream arg1, QRectF arg2)
 
static QDataStream Write (QDataStream arg1, QDateTime arg2)
 
static QDataStream Write (QDataStream arg1, QUrl arg2)
 
static QDataStream Write (QDataStream arg1, QTime arg2)
 
static QDataStream Write (QDataStream arg1, QLocale arg2)
 
static QDataStream Write (QDataStream arg1, QBitArray arg2)
 
static QDataStream Write (QDataStream arg1, QUuid arg2)
 
static QDataStream Write (QDataStream arg1, QLine arg2)
 
static QDataStream Write (QDataStream arg1, QDate arg2)
 
static QDataStream Write (QDataStream @out, QRegExp regExp)
 
static QDataStream Write (QDataStream arg1, QRect arg2)
 
static QDataStream Write (QDataStream arg1, QSize arg2)
 
static QDataStream Write (QDataStream s, QVariant.Type p)
 
static QDataStream Write (QDataStream arg1, string arg2)
 
static QDataStream Write (QDataStream @out, System.Collections.Generic.List< string > list)
 
static QDataStream Read (QDataStream arg1, QChar arg2)
 
static QDataStream Read (QDataStream arg1, QLocale arg2)
 
static QDataStream Read (QDataStream arg1, QRect arg2)
 
static QDataStream Read (QDataStream arg1, QEasingCurve arg2)
 
static QDataStream Read (QDataStream arg1, QDate arg2)
 
static QDataStream Read (QDataStream arg1, QUrl arg2)
 
static QDataStream Read (QDataStream arg1, QUuid arg2)
 
static QTextStream Read (QTextStream s, Qt.FuncQTextStreamQTextStream f)
 
static QDataStream Read (QDataStream arg1, QLineF arg2)
 
static QDataStream Read (QDataStream arg1, QRectF arg2)
 
static QDataStream Read (QDataStream arg1, QPointF arg2)
 
static QDataStream Read (QDataStream arg1, QLine arg2)
 
static QDataStream Read (QDataStream arg1, QBitArray arg2)
 
static QDataStream Read (QDataStream arg1, QSize arg2)
 
static QDataStream Read (QDataStream arg1, QDateTime arg2)
 
static QDataStream Read (QDataStream arg1, QTime arg2)
 
static QDataStream Read (QDataStream arg1, QPoint arg2)
 
static QDataStream Read (QDataStream @in, QRegExp regExp)
 
static QDataStream Read (QDataStream s, object p)
 
static QDataStream Read (QDataStream arg1, QByteArray arg2)
 
static QDataStream Read (QDataStream arg1, QSizeF arg2)
 
static QDataStream Read (QDataStream arg1, string arg2)
 
static QDataStream Read (QDataStream s, QVariant.Type p)
 
static QDataStream Read (QDataStream @in, System.Collections.Generic.List< string > list)
 
static double qAcos (double v)
 
static void qAddPostRoutine (System.Action arg1)
 
static string qAppName ()
 
static double qAsin (double v)
 
static double qAtan (double v)
 
static double qAtan2 (double x, double y)
 
static void qBadAlloc ()
 
static int qCeil (double v)
 
static ushort qChecksum (string s, uint len)
 
static QByteArray qCompress (QByteArray data)
 
static QByteArray qCompress (QByteArray data, int compressionLevel=-1)
 
static QByteArray qCompress (Pointer< byte > data, int nbytes)
 
static QByteArray qCompress (Pointer< byte > data, int nbytes, int compressionLevel=-1)
 
static double qCos (double v)
 
static double qExp (double v)
 
static double qFabs (double v)
 
static double qFastCos (double x)
 
static double qFastSin (double x)
 
static string qFlagLocation (string method)
 
static int qFloor (double v)
 
static bool qFuzzyCompare (double p1, double p2)
 
static bool qFuzzyCompare (float p1, float p2)
 
static bool qFuzzyIsNull (double d)
 
static bool qFuzzyIsNull (float f)
 
static uint qHash (QBitArray key)
 
static uint qHash (QChar key)
 
static uint qHash (QStringRef key)
 
static uint qHash (QUrl url)
 
static uint qHash (QPersistentModelIndex index)
 
static uint qHash (QByteArray key)
 
static uint qHash (QModelIndex index)
 
static uint qHash (uint key)
 
static uint qHash (sbyte key)
 
static uint qHash (byte key)
 
static uint qHash (short key)
 
static uint qHash (NativeLong key)
 
static uint qHash (ushort key)
 
static uint qHash (long key)
 
static uint qHash (ulong key)
 
static uint qHash (int key)
 
static uint qHash (string key)
 
static uint qHash (NativeULong key)
 
static double qInf ()
 
static Qt.ActionQtMsgTypeString qInstallMsgHandler (Qt.ActionQtMsgTypeString arg1)
 
static int qIntCast (float f)
 
static int qIntCast (double f)
 
static bool qIsFinite (double d)
 
static bool qIsFinite (float f)
 
static bool qIsInf (float f)
 
static bool qIsInf (double d)
 
static bool qIsNaN (float f)
 
static bool qIsNaN (double d)
 
static bool qIsNull (float f)
 
static bool qIsNull (double d)
 
static double qLn (double v)
 
static double qPow (double x, double y)
 
static double qQNaN ()
 
static void qRegisterStaticPluginInstanceFunction (Qt.FuncQObject function)
 
static void qRemovePostRoutine (System.Action arg1)
 
static int qRound (double d)
 
static long qRound64 (double d)
 
static double qSNaN ()
 
static bool qSharedBuild ()
 
static double qSin (double v)
 
static double qSqrt (double v)
 
static bool qStringComparisonHelper (QStringRef s1, string s2)
 
static double qTan (double v)
 
static QByteArray qUncompress (QByteArray data)
 
static QByteArray qUncompress (Pointer< byte > data, int nbytes)
 
static string qVersion ()
 
static void Qbswap_helper (Pointer< byte > src, Pointer< byte > dest, int size)
 
static QByteArray Qgetenv (string varName)
 
static bool Qputenv (string varName, QByteArray value)
 
static int Qrand ()
 
static void Qsrand (uint seed)
 
static int Qstrcmp (QByteArray str1, QByteArray str2)
 
static int Qstrcmp (QByteArray str1, string str2)
 
static int Qstrcmp (string str1, QByteArray str2)
 
static int Qstrcmp (string str1, string str2)
 
static Pointer< sbyte > Qstrcpy (Pointer< sbyte > dst, string src)
 
static Pointer< sbyte > Qstrdup (string arg1)
 
static int Qstricmp (string arg1, string arg2)
 
static uint Qstrlen (string str)
 
static int Qstrncmp (string str1, string str2, uint len)
 
static Pointer< sbyte > Qstrncpy (Pointer< sbyte > dst, string src, uint len)
 
static int Qstrnicmp (string arg1, string arg2, uint len)
 
static uint Qstrnlen (string str, uint maxlen)
 
static string QtTrId (string id, int n=-1)
 

Protected Member Functions

 QFormLayout (System.Type dummy)
 
- Protected Member Functions inherited from QtGui.QLayout
 QLayout (System.Type dummy)
 
new void AddChildLayout (QLayout l)
 
 
new void AddChildWidget (QWidget w)
 
 
new QRect AlignmentRect (QRect arg1)
 
 
override void OnChildEvent (QChildEvent e)
 
 
new void OnWidgetEvent (QEvent arg1)
 
- Protected Member Functions inherited from QtCore.QObject
 QObject (System.Type dummy)
 
virtual void ConnectNotify (string signal)
 
 
virtual void OnCustomEvent (QEvent arg1)
 
 
new void OnDestroyed (QObject arg1=null)
 
 
virtual void DisconnectNotify (string signal)
 
 
new int Receivers (string signal)
 
 
new QObject Sender ()
 
 
new int SenderSignalIndex ()
 
 
virtual void OnTimerEvent (QTimerEvent arg1)
 
 

Properties

override QRect Geometry [get, set]
 
 
new int spacing [get, set]
 
 
new FieldGrowthPolicy fieldGrowthPolicy [get, set]
 
 
new RowWrapPolicy rowWrapPolicy [get, set]
 
 
new Qt.AlignmentFlag LabelAlignment [get, set]
 
 
new Qt.AlignmentFlag FormAlignment [get, set]
 
 
new int HorizontalSpacing [get, set]
 
 
new int VerticalSpacing [get, set]
 
 
static new QMetaObject StaticMetaObject [get]
 
new IQFormLayoutSignals Emit [get]
 
- Properties inherited from QtGui.QLayout
virtual EventHandler
< QEventArgs< QEvent > > 
WidgetEvent
 
new Qt.AlignmentFlag Alignment [get, set]
 
 
new QMargins ContentsMargins [get, set]
 
 
virtual QRect Geometry [get, set]
 
 
new QWidget MenuBar [get, set]
 
 
new int Margin [get, set]
 
 
new int Spacing [get, set]
 
 
new SizeConstraint sizeConstraint [get, set]
 
 
static new QMetaObject StaticMetaObject [get]
 
new Qt.AlignmentFlag Align [get, set]
 
new IQLayoutSignals Emit [get]
 
- Properties inherited from QtCore.QObject
virtual EventHandler
< QEventArgs< QChildEvent > > 
ChildEvent
 
 
virtual EventHandler
< QEventArgs< QEvent > > 
CustomEvent
 
 
virtual EventHandler
< QEventArgs< QEvent > > 
Event
 
 
virtual EventHandler
< QEventArgs< QTimerEvent > > 
TimerEvent
 
 
Slot< QObjectDestroyedQObject
 
Slot Destroyed
 
 
new QObject Parent [get, set]
 
 
virtual System.IntPtr SmokeObject [get, set]
 
new string ObjectName [get, set]
 
 
static new QMetaObject StaticMetaObject [get]
 
 
static new QMetaObject StaticQtMetaObject [get]
 
new IQObjectSignals Emit [get]
 
- Properties inherited from QtGui.IQLayoutItem
Qt.AlignmentFlag Alignment [get, set]
 
QRect Geometry [get, set]
 

Additional Inherited Members

- Protected Attributes inherited from QtCore.QObject
object Q_EMIT = null
 
SmokeInvocation interceptor
 
readonly List< QEventHandler > eventFilters = new List<QEventHandler>()
 

Detailed Description

The QFormLayout class manages forms of input widgets and their associated labels.

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.).

Traditionally, such two-column form layouts were achieved using QGridLayout. QFormLayout is a higher-level alternative that provides the following advantages:

Adherence to the different platform's look and feel guidelines.For example, the Mac OS X Aqua and KDE guidelines specify that the labels should be right-aligned, whereas Windows and GNOME applications normally use left-alignment.

Support for wrapping long rows.For devices with small displays, QFormLayout can be set to wrap long rows, or even to wrap all rows.

Convenient API for creating label–field pairs.The addRow() overload that takes a QString and a QWidget * creates a QLabel behind the scenes and automatically set up its buddy. We can then write code like this:

QFormLayout *formLayout = new QFormLayout;

formLayout->addRow(tr("&Name:"), nameLineEdit);

formLayout->addRow(tr("&Email:"), emailLineEdit);

formLayout->addRow(tr("&Age:"), ageSpinBox);

setLayout(formLayout);

Compare this with the following code, written using QGridLayout:

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);

The table below shows the default appearance in different styles.

QCommonStyle derived styles (except QPlastiqueStyle)QMacStyleQPlastiqueStyleQt Extended styles

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 QGridLayout.) Style based on the Mac OS X Aqua guidelines. Labels are right-aligned, the fields don't grow beyond their size hint, and the form is horizontally centered. Recommended style for KDE applications. Similar to MacStyle, except that the form is left-aligned and all fields grow to fill the available space. 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.

The form styles can be also be overridden individually by calling setLabelAlignment(), setFormAlignment(), setFieldGrowthPolicy(), and setRowWrapPolicy(). For example, to simulate the form layout appearance of QMacStyle on all platforms, but with left-aligned labels, you could write:

formLayout->setRowWrapPolicy(QFormLayout::DontWrapRows);

formLayout->setFieldGrowthPolicy(QFormLayout::FieldsStayAtSizeHint);

formLayout->setFormAlignment(Qt::AlignHCenter | Qt::AlignTop);

formLayout->setLabelAlignment(Qt::AlignLeft);

See also QGridLayout, QBoxLayout, and QStackedLayout.

Member Enumeration Documentation

This enum specifies the different policies that can be used to control the way in which the form's fields grow.

See also fieldGrowthPolicy.

Enumerator:
AllNonFixedFieldsGrow 

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.

ExpandingFieldsGrow 

Fields with an horizontal size policy of Expanding or MinimumExpanding 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.

FieldsStayAtSizeHint 

The fields never grow beyond their effective size hint. This is the default for QMacStyle.

This enum specifies the types of widgets (or other layout items) that may appear in a row.

See also itemAt() and getItemPosition().

Enumerator:
FieldRole 

A field widget.

LabelRole 

A label widget.

SpanningRole 

A widget that spans label and field columns.

This enum specifies the different policies that can be used to control the way in which the form's rows wrap.

See also rowWrapPolicy.

Enumerator:
DontWrapRows 

Fields are always laid out next to their label. This is the default policy for all styles except Qt Extended styles and QS60Style.

WrapAllRows 

Fields are always laid out below their label.

WrapLongRows 

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 QS60Style.

Constructor & Destructor Documentation

QtGui.QFormLayout.QFormLayout ( System.Type  dummy)
protected
QtGui.QFormLayout.QFormLayout ( QWidget  parent = null)

Constructs a new form layout with the given parent widget.

See also QWidget::setLayout().

Member Function Documentation

override void QtGui.QFormLayout.AddItem ( IQLayoutItem  item)
virtual

Reimplemented from QLayout::addItem().

Implements QtGui.QLayout.

new void QtGui.QFormLayout.AddRow ( QWidget  widget)

This is an overloaded function.

Adds the specified widget at the end of this form layout. The widget spans both columns.

new void QtGui.QFormLayout.AddRow ( QLayout  layout)

This is an overloaded function.

Adds the specified layout at the end of this form layout. The layout spans both columns.

new void QtGui.QFormLayout.AddRow ( QWidget  label,
QWidget  field 
)

Adds a new row to the bottom of this form layout, with the given label and field.

See also insertRow().

new void QtGui.QFormLayout.AddRow ( QWidget  label,
QLayout  field 
)

This is an overloaded function.

new void QtGui.QFormLayout.AddRow ( string  labelText,
QWidget  field 
)

This is an overloaded function.

This overload automatically creates a QLabel behind the scenes with labelText as its text. The field is set as the new QLabel's buddy.

new void QtGui.QFormLayout.AddRow ( string  labelText,
QLayout  field 
)

This is an overloaded function.

This overload automatically creates a QLabel behind the scenes with labelText as its text.

override int QtGui.QFormLayout.Count ( )
virtual

Reimplemented from QLayout::count().

Implements QtGui.QLayout.

override void QtGui.QFormLayout.CreateProxy ( )
virtual

Reimplemented from QtCore.QObject.

new void QtGui.QFormLayout.Dispose ( )
override Qt.Orientation QtGui.QFormLayout.ExpandingDirections ( )
virtual

Reimplemented from QLayoutItem::expandingDirections().

Reimplemented from QtGui.QLayout.

new Qt.AlignmentFlag QtGui.QFormLayout.formAlignment ( )
new void QtGui.QFormLayout.GetItemPosition ( int  index,
ref int  rowPtr,
QFormLayout.ItemRole  rolePtr 
)

Retrieves the row and role (column) of the item at the specified index. If index is out of bounds, *rowPtr is set to -1; otherwise the row is stored in *rowPtr and the role is stored in *rolePtr.

See also itemAt(), count(), getLayoutPosition(), and getWidgetPosition().

new void QtGui.QFormLayout.GetLayoutPosition ( QLayout  layout,
ref int  rowPtr,
QFormLayout.ItemRole  rolePtr 
)

Retrieves the row and role (column) of the specified child layout. If layout is not in the form layout, *rowPtr is set to -1; otherwise the row is stored in *rowPtr and the role is stored in *rolePtr.

new void QtGui.QFormLayout.GetWidgetPosition ( QWidget  widget,
ref int  rowPtr,
QFormLayout.ItemRole  rolePtr 
)

Retrieves the row and role (column) of the specified widget in the layout. If widget is not in the layout, *rowPtr is set to -1; otherwise the row is stored in *rowPtr and the role is stored in *rolePtr.

See also getItemPosition() and itemAt().

override bool QtGui.QFormLayout.HasHeightForWidth ( )
virtual

Reimplemented from QLayoutItem::hasHeightForWidth().

Reimplemented from QtGui.QLayout.

override int QtGui.QFormLayout.HeightForWidth ( int  width)
virtual

Reimplemented from QLayoutItem::heightForWidth().

Reimplemented from QtGui.QLayout.

new void QtGui.QFormLayout.InsertRow ( int  row,
QWidget  widget 
)

This is an overloaded function.

Inserts the specified widget at position row in this form layout. The widget spans both columns. If row is out of bounds, the widget is added at the end.

new void QtGui.QFormLayout.InsertRow ( int  row,
QLayout  layout 
)

This is an overloaded function.

Inserts the specified layout at position row in this form layout. The layout spans both columns. If row is out of bounds, the widget is added at the end.

new void QtGui.QFormLayout.InsertRow ( int  row,
QWidget  label,
QWidget  field 
)

Inserts a new row at position row in this form layout, with the given label and field. If row is out of bounds, the new row is added at the end.

See also addRow().

new void QtGui.QFormLayout.InsertRow ( int  row,
QWidget  label,
QLayout  field 
)

This is an overloaded function.

new void QtGui.QFormLayout.InsertRow ( int  row,
string  labelText,
QWidget  field 
)

This is an overloaded function.

This overload automatically creates a QLabel behind the scenes with labelText as its text. The field is set as the new QLabel's buddy.

new void QtGui.QFormLayout.InsertRow ( int  row,
string  labelText,
QLayout  field 
)

This is an overloaded function.

This overload automatically creates a QLabel behind the scenes with labelText as its text.

override void QtGui.QFormLayout.Invalidate ( )
virtual

Reimplemented from QLayoutItem::invalidate().

Reimplemented from QtGui.QLayout.

override IQLayoutItem QtGui.QFormLayout.ItemAt ( int  index)
virtual

Reimplemented from QLayout::itemAt().

Implements QtGui.QLayout.

new IQLayoutItem QtGui.QFormLayout.ItemAt ( int  row,
QFormLayout.ItemRole  role 
)

Returns the layout item in the given row with the specified role (column). Returns 0 if there is no such item.

See also QLayout::itemAt() and setItem().

new Qt.AlignmentFlag QtGui.QFormLayout.labelAlignment ( )
new QWidget QtGui.QFormLayout.LabelForField ( QWidget  field)

Returns the label associated with the given field.

See also itemAt().

new QWidget QtGui.QFormLayout.LabelForField ( QLayout  field)

This is an overloaded function.

override QSize QtGui.QFormLayout.MinimumSize ( )
virtual

Reimplemented from QLayoutItem::minimumSize().

Reimplemented from QtGui.QLayout.

new int QtGui.QFormLayout.RowCount ( )

Returns the number of rows in the form.

See also QLayout::count().

new void QtGui.QFormLayout.SetFormAlignment ( Qt.AlignmentFlag  alignment)
new void QtGui.QFormLayout.SetItem ( int  row,
QFormLayout.ItemRole  role,
IQLayoutItem  item 
)

Sets the item in the given row for the given role to item, extending the layout with empty rows if necessary.

If the cell is already occupied, the item is not inserted and an error message is sent to the console. The item spans both columns.

Warning: Do not use this function to add child layouts or child widget items. Use setLayout() or setWidget() instead.

See also setLayout().

new void QtGui.QFormLayout.SetLabelAlignment ( Qt.AlignmentFlag  alignment)
new void QtGui.QFormLayout.SetLayout ( int  row,
QFormLayout.ItemRole  role,
QLayout  layout 
)

Sets the sub-layout in the given row for the given role to layout, extending the form layout with empty rows if necessary.

If the cell is already occupied, the layout is not inserted and an error message is sent to the console.

Note: For most applications, addRow() or insertRow() should be used instead of setLayout().

See also setWidget().

new void QtGui.QFormLayout.SetWidget ( int  row,
QFormLayout.ItemRole  role,
QWidget  widget 
)

Sets the widget in the given row for the given role to widget, extending the layout with empty rows if necessary.

If the cell is already occupied, the widget is not inserted and an error message is sent to the console.

Note: For most applications, addRow() or insertRow() should be used instead of setWidget().

See also setLayout().

override QSize QtGui.QFormLayout.SizeHint ( )
virtual

Reimplemented from QLayoutItem::sizeHint().

Implements QtGui.QLayout.

override IQLayoutItem QtGui.QFormLayout.TakeAt ( int  index)
virtual

Reimplemented from QLayout::takeAt().

Implements QtGui.QLayout.

static string QtGui.QFormLayout.Tr ( string  s,
string  c = null 
)
static
static string QtGui.QFormLayout.Tr ( string  s,
string  c,
int  n 
)
static
static string QtGui.QFormLayout.TrUtf8 ( string  s,
string  c = null 
)
static
static string QtGui.QFormLayout.TrUtf8 ( string  s,
string  c,
int  n 
)
static

Property Documentation

new IQFormLayoutSignals QtGui.QFormLayout.Emit
getprotected
new FieldGrowthPolicy QtGui.QFormLayout.fieldGrowthPolicy
getset

This property holds the way in which the form's fields grow.

The default value depends on the widget or application style. For QMacStyle, the default is FieldsStayAtSizeHint; for QCommonStyle derived styles (like Plastique and Windows), the default is ExpandingFieldsGrow; for Qt Extended styles, the default is AllNonFixedFieldsGrow.

If none of the fields can grow and the form is resized, extra space is distributed according to the current form alignment.

new Qt.AlignmentFlag QtGui.QFormLayout.FormAlignment
getset

This property holds the alignment of the form layout's contents within the layout's geometry.

The default value depends on the widget or application style. For QMacStyle, the default is Qt::AlignHCenter | Qt::AlignTop; for the other styles, the default is Qt::AlignLeft | Qt::AlignTop.

override QRect QtGui.QFormLayout.Geometry
getset

Reimplemented from QLayoutItem::setGeometry().

new int QtGui.QFormLayout.HorizontalSpacing
getset

This property holds the spacing between widgets that are laid out side by side.

By default, if no value is explicitly set, the layout's horizontal spacing is inherited from the parent layout, or from the style settings for the parent widget.

new Qt.AlignmentFlag QtGui.QFormLayout.LabelAlignment
getset

This property holds the horizontal alignment of the labels.

The default value depends on the widget or application style. For QCommonStyle derived styles, except for QPlastiqueStyle, the default is Qt::AlignLeft; for the other styles, the default is Qt::AlignRight.

new RowWrapPolicy QtGui.QFormLayout.rowWrapPolicy
getset

This property holds the way in which the form's rows wrap.

The default value depends on the widget or application style. For Qt Extended styles and QS60Style, the default is WrapLongRows; for the other styles, the default is DontWrapRows.

If you want to display each label above its associated field (instead of next to it), set this property to WrapAllRows.

new int QtGui.QFormLayout.spacing
getset

If the vertical spacing is equal to the horizontal spacing, this function returns that value; otherwise it returns -1.

This function sets both the vertical and horizontal spacing to spacing.

new QMetaObject QtGui.QFormLayout.StaticMetaObject
staticget
new int QtGui.QFormLayout.VerticalSpacing
getset

This property holds the spacing between widgets that are laid out vertically.

By default, if no value is explicitly set, the layout's vertical spacing is inherited from the parent layout, or from the style settings for the parent widget.