Qyoto  4.0.7
Qyoto is a C# language binding for Qt
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Properties
QtGui.QLayout Class Referenceabstract

The QLayout class is the base class of geometry managers. More...

Inheritance diagram for QtGui.QLayout:
Collaboration diagram for QtGui.QLayout:

Public Types

enum  SizeConstraint {
  SetDefaultConstraint = 0, SetFixedSize = 3, SetMaximumSize = 4, SetMinAndMaxSize = 5,
  SetMinimumSize = 2, SetNoConstraint = 1
}
  More...
 

Public Member Functions

 QLayout ()
  More...
 
 QLayout (QWidget parent)
  More...
 
override void CreateProxy ()
 
new bool Activate ()
  More...
 
abstract void AddItem (IQLayoutItem item)
  More...
 
new void AddWidget (QWidget w)
  More...
 
new void GetContentsMargins (ref int left, ref int top, ref int right, ref int bottom)
  More...
 
virtual int IndexOf (QWidget widget)
  More...
 
virtual void Invalidate ()
  More...
 
abstract IQLayoutItem ItemAt (int index)
  More...
 
new void RemoveItem (IQLayoutItem item)
  More...
 
new void RemoveWidget (QWidget w)
  More...
 
new bool SetAlignment (QWidget w, Qt.AlignmentFlag alignment)
  More...
 
new bool SetAlignment (QLayout l, Qt.AlignmentFlag alignment)
  More...
 
new void SetContentsMargins (int left, int top, int right, int bottom)
  More...
 
new void SetEnabled (bool enable)
  More...
 
abstract IQLayoutItem TakeAt (int index)
  More...
 
new int TotalHeightForWidth (int w)
 
new void Update ()
  More...
 
new void Dispose ()
 
virtual int HeightForWidth (int w)
  More...
 
virtual int MinimumHeightForWidth (int w)
  More...
 
- Public Member Functions inherited from QtCore.QObject
 QObject (QObject parent=null)
  More...
 
new bool BlockSignals (bool b)
  More...
 
new bool Connect (QObject sender, string signal, string member, Qt.ConnectionType type=Qt.ConnectionType.AutoConnection)
  More...
 
new void DeleteLater ()
  More...
 
new bool Disconnect (QObject receiver, string member=null)
  More...
 
new bool Disconnect (string signal=null, QObject receiver=null, string member=null)
  More...
 
new void DumpObjectInfo ()
  More...
 
new void DumpObjectTree ()
  More...
 
virtual bool OnEvent (QEvent e)
  More...
 
virtual bool EventFilter (QObject watched, QEvent @event)
  More...
 
new bool Inherits (string classname)
  More...
 
new void InstallEventFilter (QObject filterObj)
  More...
 
new void KillTimer (int id)
  More...
 
new object Property (string name)
  More...
 
new void RemoveEventFilter (QObject obj)
  More...
 
new bool SetProperty (string name, object value)
  More...
 
new void SetUserData (uint id, QObjectUserData data)
 
new int StartTimer (int interval)
  More...
 
new QObjectUserData UserData (uint id)
 
new void Dispose ()
 
- Public Member Functions inherited from QtCore.Qt
delegate QTextStream FuncQTextStreamQTextStream (QTextStream qTextStream)
 
delegate void ActionQtMsgTypeString (QtMsgType qtMsgType, string @string)
 
delegate QObject FuncQObject ()
 
delegate string FuncStringQByteArray (QByteArray qByteArray)
 
delegate QByteArray FuncQByteArrayString (string @string)
 

Static Public Member Functions

static QSize ClosestAcceptableSize (QWidget w, QSize s)
  More...
 
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)
  More...
 
static bool Connect (QObject sender, string signal, QObject receiver, string member, Qt.ConnectionType type=Qt.ConnectionType.AutoConnection)
  More...
 
static bool Disconnect (QObject sender, QMetaMethod signal, QObject receiver, QMetaMethod member)
  More...
 
static bool Disconnect (QObject sender, string signal, QObject receiver, string member)
  More...
 
static string Tr (string s, string c=null)
  More...
 
static string Tr (string s, string c, int n)
  More...
 
static string TrUtf8 (string s, string c=null)
  More...
 
static string TrUtf8 (string s, string c, int n)
  More...
 
- Static Public Member Functions inherited from QtCore.Qt
static QDataStream Write (QDataStream s, object p)
 
static QDataStream Write (QDataStream stream, QSizeF size)
  More...
 
static QDataStream Write (QDataStream stream, QPoint point)
  More...
 
static QTextStream Write (QTextStream s, Qt.FuncQTextStreamQTextStream f)
 
static QDataStream Write (QDataStream stream, QLineF line)
  More...
 
static QDataStream Write (QDataStream stream, QPointF point)
  More...
 
static QDataStream Write (QDataStream @out, QChar chr)
  More...
 
static QDataStream Write (QDataStream @out, QByteArray ba)
  More...
 
static QDataStream Write (QDataStream stream, QEasingCurve easing)
  More...
 
static QDataStream Write (QDataStream stream, QRectF rectangle)
  More...
 
static QDataStream Write (QDataStream @out, QDateTime dateTime)
  More...
 
static QDataStream Write (QDataStream @out, QUrl url)
  More...
 
static QDataStream Write (QDataStream @out, QTime time)
  More...
 
static QDataStream Write (QDataStream arg1, QLocale arg2)
 
static QDataStream Write (QDataStream @out, QBitArray ba)
  More...
 
static QDataStream Write (QDataStream s, QUuid id)
  More...
 
static QDataStream Write (QDataStream stream, QLine line)
  More...
 
static QDataStream Write (QDataStream @out, QDate date)
  More...
 
static QDataStream Write (QDataStream @out, QRegExp regExp)
  More...
 
static QDataStream Write (QDataStream stream, QRect rectangle)
  More...
 
static QDataStream Write (QDataStream stream, QSize size)
  More...
 
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)
  More...
 
static QDataStream Read (QDataStream @in, QChar chr)
  More...
 
static QDataStream Read (QDataStream arg1, QLocale arg2)
 
static QDataStream Read (QDataStream stream, QRect rectangle)
  More...
 
static QDataStream Read (QDataStream arg1, QEasingCurve arg2)
 
static QDataStream Read (QDataStream @in, QDate date)
  More...
 
static QDataStream Read (QDataStream @in, QUrl url)
  More...
 
static QDataStream Read (QDataStream s, QUuid id)
  More...
 
static QTextStream Read (QTextStream s, Qt.FuncQTextStreamQTextStream f)
 
static QDataStream Read (QDataStream stream, QLineF line)
  More...
 
static QDataStream Read (QDataStream stream, QRectF rectangle)
  More...
 
static QDataStream Read (QDataStream stream, QPointF point)
  More...
 
static QDataStream Read (QDataStream stream, QLine line)
  More...
 
static QDataStream Read (QDataStream @in, QBitArray ba)
  More...
 
static QDataStream Read (QDataStream stream, QSize size)
  More...
 
static QDataStream Read (QDataStream @in, QDateTime dateTime)
  More...
 
static QDataStream Read (QDataStream @in, QTime time)
  More...
 
static QDataStream Read (QDataStream stream, QPoint point)
  More...
 
static QDataStream Read (QDataStream @in, QRegExp regExp)
  More...
 
static QDataStream Read (QDataStream s, object p)
 
static QDataStream Read (QDataStream @in, QByteArray ba)
  More...
 
static QDataStream Read (QDataStream stream, QSizeF size)
  More...
 
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)
  More...
 
static double QAcos (double v)
  More...
 
static void QAddPostRoutine (System.Action ptr)
  More...
 
static double QAsin (double v)
  More...
 
static double QAtan (double v)
  More...
 
static double QAtan2 (double x, double y)
  More...
 
static void QBadAlloc ()
 
static int QCeil (double v)
  More...
 
static ushort QChecksum (string s, uint len)
  More...
 
static QByteArray QCompress (QByteArray data, int compressionLevel=-1)
  More...
 
static QByteArray QCompress (Pointer< byte > data, int nbytes, int compressionLevel=-1)
  More...
 
static double QCos (double v)
  More...
 
static double QExp (double v)
  More...
 
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)
  More...
 
static bool QFuzzyCompare (double p1, double p2)
  More...
 
static bool QFuzzyCompare (float p1, float p2)
  More...
 
static bool QFuzzyIsNull (double d)
 
static bool QFuzzyIsNull (float f)
 
static uint QHash (QBitArray key)
  More...
 
static uint QHash (QChar key)
  More...
 
static uint QHash (QStringRef key)
 
static uint QHash (QUrl url)
  More...
 
static uint QHash (QPersistentModelIndex index)
 
static uint QHash (QByteArray key)
  More...
 
static uint QHash (QModelIndex index)
 
static uint QHash (uint key)
  More...
 
static uint QHash (char key)
  More...
 
static uint QHash (byte key)
  More...
 
static uint QHash (short key)
  More...
 
static uint QHash (NativeLong key)
  More...
 
static uint QHash (ushort key)
  More...
 
static uint QHash (long key)
  More...
 
static uint QHash (ulong key)
  More...
 
static uint QHash (int key)
  More...
 
static uint QHash (string key)
  More...
 
static uint QHash (NativeULong key)
  More...
 
static Qt.ActionQtMsgTypeString QInstallMsgHandler (Qt.ActionQtMsgTypeString handler)
  More...
 
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)
  More...
 
static double QPow (double x, double y)
  More...
 
static void QRegisterStaticPluginInstanceFunction (Qt.FuncQObject function)
  More...
 
static void QRemovePostRoutine (System.Action arg1)
 
static int QRound (double d)
  More...
 
static long QRound64 (double d)
  More...
 
static double QSin (double v)
  More...
 
static double QSqrt (double v)
  More...
 
static bool QStringComparisonHelper (QStringRef s1, string s2)
 
static double QTan (double v)
  More...
 
static QByteArray QUncompress (QByteArray data)
  More...
 
static QByteArray QUncompress (Pointer< byte > data, int nbytes)
  More...
 
static void Qbswap_helper (Pointer< byte > src, Pointer< byte > dest, int size)
 
static QByteArray Qgetenv (string varName)
  More...
 
static bool Qputenv (string varName, QByteArray value)
  More...
 
static void Qsrand (uint seed)
  More...
 
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)
  More...
 
static Pointer< sbyte > Qstrcpy (Pointer< sbyte > dst, string src)
  More...
 
static Pointer< sbyte > Qstrdup (string src)
  More...
 
static int Qstricmp (string str1, string str2)
  More...
 
static uint Qstrlen (string str)
  More...
 
static int Qstrncmp (string str1, string str2, uint len)
  More...
 
static Pointer< sbyte > Qstrncpy (Pointer< sbyte > dst, string src, uint len)
  More...
 
static int Qstrnicmp (string str1, string str2, uint len)
  More...
 
static uint Qstrnlen (string str, uint maxlen)
  More...
 

Protected Member Functions

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

Properties

virtual EventHandler
< QEventArgs< QEvent > > 
WidgetEvent
 
Qt.AlignmentFlag Alignment [get, set]
  More...
 
QMargins ContentsMargins [get, set]
  More...
 
virtual QRect Geometry [get, set]
  More...
 
QWidget MenuBar [get, set]
  More...
 
virtual Qt.Orientation ExpandingDirections [get]
  More...
 
virtual bool IsEmpty [get]
  More...
 
virtual QLayout Layout [get]
  More...
 
virtual QSize MaximumSize [get]
  More...
 
virtual QSize MinimumSize [get]
  More...
 
QSizePolicy.ControlType ControlTypes [get]
  More...
 
virtual bool HasHeightForWidth [get]
  More...
 
virtual QSize SizeHint [get]
  More...
 
virtual QSpacerItem SpacerItem [get]
  More...
 
virtual QWidget Widget [get]
  More...
 
QRect ContentsRect [get]
  More...
 
virtual int Count [get]
  More...
 
bool IsEnabled [get]
  More...
 
QWidget ParentWidget [get]
  More...
 
QSize TotalMaximumSize [get]
 
QSize TotalMinimumSize [get]
 
QSize TotalSizeHint [get]
 
new int Margin [get, set]
  More...
 
new int Spacing [get, set]
  More...
 
new SizeConstraint sizeConstraint [get, set]
  More...
 
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
  More...
 
virtual EventHandler
< QEventArgs< QEvent > > 
CustomEvent
  More...
 
virtual EventHandler
< QEventArgs< QEvent > > 
Event
  More...
 
virtual EventHandler
< QEventArgs< QTimerEvent > > 
TimerEvent
  More...
 
Slot< QObjectDestroyedObj
  More...
 
Slot Destroyed
  More...
 
QObject Parent [get, set]
  More...
 
System.Collections.Generic.List
< QObject
Children [get]
  More...
 
System.Collections.Generic.List
< QByteArray
DynamicPropertyNames [get]
  More...
 
bool IsWidgetType [get]
  More...
 
static uint RegisterUserData [get]
 
QObject Sender [get]
  More...
 
int SenderSignalIndex [get]
  More...
 
bool SignalsBlocked [get]
  More...
 
virtual System.IntPtr SmokeObject [get, set]
 
new string ObjectName [get, set]
  More...
 
static new QMetaObject StaticMetaObject [get]
  More...
 
static new QMetaObject StaticQtMetaObject [get]
 
new IQObjectSignals Emit [get]
 
- Properties inherited from QtCore.Qt
static string QAppName [get]
 
static double QInf [get]
 
static double QQNaN [get]
 
static double QSNaN [get]
 
static bool QSharedBuild [get]
 
static string QVersion [get]
  More...
 
static int Qrand [get]
  More...
 
- Properties inherited from QtGui.IQLayoutItem
Qt.AlignmentFlag Alignment [get, set]
  More...
 
QRect Geometry [get, set]
  More...
 
QSizePolicy.ControlType ControlTypes [get]
  More...
 
Qt.Orientation ExpandingDirections [get]
  More...
 
System.Boolean HasHeightForWidth [get]
  More...
 
System.Boolean IsEmpty [get]
  More...
 
QLayout Layout [get]
  More...
 
QSize MaximumSize [get]
  More...
 
QSize MinimumSize [get]
  More...
 
QSize SizeHint [get]
  More...
 
QSpacerItem SpacerItem [get]
  More...
 
QWidget Widget [get]
  More...
 

Additional Inherited Members

- Static Public Attributes inherited from QtCore.Qt
</para > *< para > Creating QM
files suitable for use with
this[SmokeMethod("qtTrId(const
char*, int)")] static strin 
QtTrId )(string id, int n=-1)
 
- Protected Attributes inherited from QtCore.QObject
object Q_EMIT = null
 
SmokeInvocation interceptor
 
readonly List< QEventHandler > eventFilters = new List<QEventHandler>()
 

Detailed Description

The QLayout class is the base class of geometry managers.

This is an abstract base class inherited by the concrete classes QBoxLayout, QGridLayout, QFormLayout, and QStackedLayout.

For users of QLayout subclasses or of QMainWindow there is seldom any need to use the basic functions provided by QLayout, such as setSizeConstraint() or setMenuBar(). See Layout Management for more information.

To make your own layout manager, implement the functions addItem(), sizeHint(), setGeometry(), itemAt() and takeAt(). You should also implement minimumSize() to ensure your layout isn't resized to zero size if there is too little space. To support children whose heights depend on their widths, implement hasHeightForWidth() and heightForWidth(). See the Border Layout and Flow Layout examples for more information about implementing custom layout managers.

Geometry management stops when the layout manager is deleted.

See also QLayoutItem, Layout Management, Basic Layouts Example, Border Layout Example, and Flow Layout Example.

Member Enumeration Documentation

The possible values are:

See also setSizeConstraint().

Enumerator
SetDefaultConstraint 

The main widget's minimum size is set to minimumSize(), unless the widget already has a minimum size.

SetFixedSize 

The main widget's size is set to sizeHint(); it cannot be resized at all.

SetMaximumSize 

The main widget's maximum size is set to maximumSize(); it cannot be larger.

SetMinAndMaxSize 

The main widget's minimum size is set to minimumSize() and its maximum size is set to maximumSize().

SetMinimumSize 

The main widget's minimum size is set to minimumSize(); it cannot be smaller.

SetNoConstraint 

The widget is not constrained.

Constructor & Destructor Documentation

QtGui.QLayout.QLayout ( System.Type  dummy)
protected
QtGui.QLayout.QLayout ( )

Constructs a new child QLayout.

This layout has to be inserted into another layout before geometry management will work.

Here is the call graph for this function:

QtGui.QLayout.QLayout ( QWidget  parent)

Constructs a new top-level QLayout, with parent parent. parent may not be 0.

There can be only one top-level layout for a widget. It is returned by QWidget::layout().

Here is the call graph for this function:

Member Function Documentation

new bool QtGui.QLayout.Activate ( )

Redoes the layout for parentWidget() if necessary.

You should generally not need to call this because it is automatically called at the most appropriate times. It returns true if the layout was redone.

See also update() and QWidget::updateGeometry().

new void QtGui.QLayout.AddChildLayout ( QLayout  l)
protected

This function is called from addLayout() or insertLayout() functions in subclasses to add layout l as a sub-layout.

The only scenario in which you need to call it directly is if you implement a custom layout that supports nested layouts.

See also QBoxLayout::addLayout(), QBoxLayout::insertLayout(), and QGridLayout::addLayout().

new void QtGui.QLayout.AddChildWidget ( QWidget  w)
protected

This function is called from addWidget() functions in subclasses to add w as a managed widget of a layout.

If w is already managed by a layout, this function will give a warning and remove w from that layout. This function must therefore be called before adding w to the layout's data structure.

abstract void QtGui.QLayout.AddItem ( IQLayoutItem  item)
pure virtual

Implemented in subclasses to add an item. How it is added is specific to each subclass.

This function is not usually called in application code. To add a widget to a layout, use the addWidget() function; to add a child layout, use the addLayout() function provided by the relevant QLayout subclass.

Note: The ownership of item is transferred to the layout, and it's the layout's responsibility to delete it.

See also addWidget(), QBoxLayout::addLayout(), and QGridLayout::addLayout().

Implemented in QtGui.QStackedLayout, QtGui.QGridLayout, QtGui.QFormLayout, and QtGui.QBoxLayout.

new void QtGui.QLayout.AddWidget ( QWidget  w)

Adds widget w to this layout in a manner specific to the layout. This function uses addItem().

new QRect QtGui.QLayout.AlignmentRect ( QRect  r)
protected

Returns the rectangle that should be covered when the geometry of this layout is set to r, provided that this layout supports setAlignment().

The result is derived from sizeHint() and expanding(). It is never larger than r.

static QSize QtGui.QLayout.ClosestAcceptableSize ( QWidget  w,
QSize  s 
)
static

Returns a size that satisfies all size constraints on widget, including heightForWidth() and that is as close as possible to size.

override void QtGui.QLayout.CreateProxy ( )
virtual

Reimplemented from QtCore.QObject.

Reimplemented in QtGui.QVBoxLayout, and QtGui.QStackedLayout.

Here is the caller graph for this function:

new void QtGui.QLayout.Dispose ( )
new void QtGui.QLayout.GetContentsMargins ( ref int  left,
ref int  top,
ref int  right,
ref int  bottom 
)

Extracts the left, top, right, and bottom margins used around the layout, and assigns them to *left, *top, *right, and *bottom (unless they are null pointers).

By default, QLayout uses the values provided by the style. On most platforms, the margin is 11 pixels in all directions.

This function was introduced in Qt 4.3.

See also setContentsMargins(), QStyle::pixelMetric(), PM_LayoutLeftMargin, PM_LayoutTopMargin, PM_LayoutRightMargin, and PM_LayoutBottomMargin.

virtual int QtGui.QLayout.HeightForWidth ( int  w)
virtual

Returns the preferred height for this layout item, given the width w.

The default implementation returns -1, indicating that the preferred height is independent of the width of the item. Using the function hasHeightForWidth() will typically be much faster than calling this function and testing for -1.

Reimplement this function in layout managers that support height for width. A typical implementation will look like this:

int MyLayout::heightForWidth(int w) const

{

if (cache_dirty || cached_width != w) {

// not all C++ compilers support "mutable"

MyLayout that = (MyLayout)this;

int h = calculateHeightForWidth(w);

that->cached_hfw = h;

return h;

}

return cached_hfw;

}

Caching is strongly recommended; without it layout will take exponential time.

See also hasHeightForWidth().

Implements QtGui.IQLayoutItem.

Reimplemented in QtGui.QGridLayout, QtGui.QFormLayout, and QtGui.QBoxLayout.

virtual int QtGui.QLayout.IndexOf ( QWidget  widget)
virtual

Searches for widget widget in this layout (not including child layouts).

Returns the index of widget, or -1 if widget is not found.

The default implementation iterates over all items using itemAt()

virtual void QtGui.QLayout.Invalidate ( )
virtual

Reimplemented from QLayoutItem::invalidate().

Implements QtGui.IQLayoutItem.

Reimplemented in QtGui.QGridLayout, QtGui.QFormLayout, and QtGui.QBoxLayout.

abstract IQLayoutItem QtGui.QLayout.ItemAt ( int  index)
pure virtual

Must be implemented in subclasses to return the layout item at index. If there is no such item, the function must return 0. Items are numbered consecutively from 0. If an item is deleted, other items will be renumbered.

This function can be used to iterate over a layout. The following code will draw a rectangle for each layout item in the layout structure of the widget.

static void paintLayout(QPainter *painter, QLayoutItem *item)

{

QLayout *layout = item->layout();

if (layout) {

for (int i = 0; i < layout->count(); ++i)

paintLayout(painter, layout->itemAt(i));

}

painter->drawRect(item->geometry());

}

void MyWidget::paintEvent(QPaintEvent *)

{

QPainter painter(this);

if (layout())

paintLayout(&painter, layout());

}

See also count() and takeAt().

Implemented in QtGui.QStackedLayout, QtGui.QGridLayout, QtGui.QFormLayout, and QtGui.QBoxLayout.

virtual int QtGui.QLayout.MinimumHeightForWidth ( int  w)
virtual

Returns the minimum height this widget needs for the given width, w. The default implementation simply returns heightForWidth(w).

Implements QtGui.IQLayoutItem.

Reimplemented in QtGui.QGridLayout, and QtGui.QBoxLayout.

override void QtGui.QLayout.OnChildEvent ( QChildEvent  e)
protected

Reimplemented from QObject::childEvent().

new void QtGui.QLayout.OnWidgetEvent ( QEvent  arg1)
protected
new void QtGui.QLayout.RemoveItem ( IQLayoutItem  item)

Removes the layout item item from the layout. It is the caller's responsibility to delete the item.

Notice that item can be a layout (since QLayout inherits QLayoutItem).

See also removeWidget() and addItem().

new void QtGui.QLayout.RemoveWidget ( QWidget  w)

Removes the widget widget from the layout. After this call, it is the caller's responsibility to give the widget a reasonable geometry or to put the widget back into a layout.

Note: The ownership of widget remains the same as when it was added.

See also removeItem(), QWidget::setGeometry(), and addWidget().

new bool QtGui.QLayout.SetAlignment ( QWidget  w,
Qt.AlignmentFlag  alignment 
)

Sets the alignment for widget w to alignment and returns true if w is found in this layout (not including child layouts); otherwise returns false.

new bool QtGui.QLayout.SetAlignment ( QLayout  l,
Qt.AlignmentFlag  alignment 
)

This is an overloaded function.

Sets the alignment for the layout l to alignment and returns true if l is found in this layout (not including child layouts); otherwise returns false.

new void QtGui.QLayout.SetContentsMargins ( int  left,
int  top,
int  right,
int  bottom 
)

Sets the left, top, right, and bottom margins to use around the layout.

By default, QLayout uses the values provided by the style. On most platforms, the margin is 11 pixels in all directions.

This function was introduced in Qt 4.3.

See also contentsMargins(), getContentsMargins(), QStyle::pixelMetric(), PM_LayoutLeftMargin, PM_LayoutTopMargin, PM_LayoutRightMargin, and PM_LayoutBottomMargin.

new void QtGui.QLayout.SetEnabled ( bool  enable)

Enables this layout if enable is true, otherwise disables it.

An enabled layout adjusts dynamically to changes; a disabled layout acts as if it did not exist.

By default all layouts are enabled.

See also isEnabled().

abstract IQLayoutItem QtGui.QLayout.TakeAt ( int  index)
pure virtual

Must be implemented in subclasses to remove the layout item at index from the layout, and return the item. If there is no such item, the function must do nothing and return 0. Items are numbered consecutively from 0. If an item is removed, other items will be renumbered.

The following code fragment shows a safe way to remove all items from a layout:

QLayoutItem *child;

while ((child = layout->takeAt(0)) != 0) {

...

delete child;

}

See also itemAt() and count().

Implemented in QtGui.QStackedLayout, QtGui.QGridLayout, QtGui.QFormLayout, and QtGui.QBoxLayout.

new int QtGui.QLayout.TotalHeightForWidth ( int  w)
static string QtGui.QLayout.Tr ( string  s,
string  c = null 
)
static
static string QtGui.QLayout.Tr ( string  s,
string  c,
int  n 
)
static
static string QtGui.QLayout.TrUtf8 ( string  s,
string  c = null 
)
static
static string QtGui.QLayout.TrUtf8 ( string  s,
string  c,
int  n 
)
static
new void QtGui.QLayout.Update ( )

Updates the layout for parentWidget().

You should generally not need to call this because it is automatically called at the most appropriate times.

See also activate() and invalidate().

Property Documentation

new Qt.AlignmentFlag QtGui.QLayout.Align
getsetprotected
Qt.AlignmentFlag QtGui.QLayout.Alignment
getset

Returns the alignment of this item.

Sets the alignment of this item to alignment.

Note: Item alignment is only supported by QLayoutItem subclasses where it would have a visual effect. Except for QSpacerItem, which provides blank space for layouts, all public Qt classes that inherit QLayoutItem support item alignment.

Sets the alignment of this item to alignment.

QMargins QtGui.QLayout.ContentsMargins
getset

Returns the margins used around the layout.

By default, QLayout uses the values provided by the style. On most platforms, the margin is 11 pixels in all directions.

This function was introduced in Qt 4.6.

Sets the margins to use around the layout.

By default, QLayout uses the values provided by the style. On most platforms, the margin is 11 pixels in all directions.

This function was introduced in Qt 4.6.

QRect QtGui.QLayout.ContentsRect
get

Returns the layout's geometry() rectangle, but taking into account the contents margins.

This function was introduced in Qt 4.3.

See also setContentsMargins() and getContentsMargins().

QSizePolicy.ControlType QtGui.QLayout.ControlTypes
get

Returns the control type(s) for the layout item. For a QWidgetItem, the control type comes from the widget's size policy; for a QLayoutItem, the control types is derived from the layout's contents.

See also QSizePolicy::controlType().

virtual int QtGui.QLayout.Count
get

Must be implemented in subclasses to return the number of items in the layout.

See also itemAt().

new IQLayoutSignals QtGui.QLayout.Emit
getprotected
virtual Qt.Orientation QtGui.QLayout.ExpandingDirections
get

Reimplemented from QLayoutItem::expandingDirections().

Returns whether this layout can make use of more space than sizeHint(). A value of Qt::Vertical or Qt::Horizontal means that it wants to grow in only one dimension, whereas Qt::Vertical | Qt::Horizontal means that it wants to grow in both dimensions.

The default implementation returns Qt::Horizontal | Qt::Vertical. Subclasses reimplement it to return a meaningful value based on their child widgets's size policies.

See also sizeHint().

virtual QRect QtGui.QLayout.Geometry
getset

Reimplemented from QLayoutItem::geometry().

Reimplemented from QLayoutItem::setGeometry().

virtual bool QtGui.QLayout.HasHeightForWidth
get

Returns true if this layout's preferred height depends on its width; otherwise returns false. The default implementation returns false.

Reimplement this function in layout managers that support height for width.

See also heightForWidth() and QWidget::heightForWidth().

virtual bool QtGui.QLayout.IsEmpty
get

Reimplemented from QLayoutItem::isEmpty().

bool QtGui.QLayout.IsEnabled
get

Returns true if the layout is enabled; otherwise returns false.

See also setEnabled().

virtual QLayout QtGui.QLayout.Layout
get

Reimplemented from QLayoutItem::layout().

new int QtGui.QLayout.Margin
getset

This property holds the width of the outside border of the layout.

Use setContentsMargins() and getContentsMargins() instead.

virtual QSize QtGui.QLayout.MaximumSize
get

Reimplemented from QLayoutItem::maximumSize().

Returns the maximum size of this layout. This is the largest size that the layout can have while still respecting the specifications.

The returned value doesn't include the space required by QWidget::setContentsMargins() or menuBar().

The default implementation allows unlimited resizing.

QWidget QtGui.QLayout.MenuBar
getset

Returns the menu bar set for this layout, or 0 if no menu bar is set.

Tells the geometry manager to place the menu bar widget at the top of parentWidget(), outside QWidget::contentsMargins(). All child widgets are placed below the bottom edge of the menu bar.

virtual QSize QtGui.QLayout.MinimumSize
get

Reimplemented from QLayoutItem::minimumSize().

Returns the minimum size of this layout. This is the smallest size that the layout can have while still respecting the specifications.

The returned value doesn't include the space required by QWidget::setContentsMargins() or menuBar().

The default implementation allows unlimited resizing.

QWidget QtGui.QLayout.ParentWidget
get

Returns the parent widget of this layout, or 0 if this layout is not installed on any widget.

If the layout is a sub-layout, this function returns the parent widget of the parent layout.

See also parent().

new SizeConstraint QtGui.QLayout.sizeConstraint
getset

This property holds the resize mode of the layout.

The default mode is SetDefaultConstraint.

Implemented in subclasses to return the preferred size of this item.

virtual QSpacerItem QtGui.QLayout.SpacerItem
get

If this item is a QSpacerItem, it is returned as a QSpacerItem; otherwise 0 is returned. This function provides type-safe casting.

new int QtGui.QLayout.Spacing
getset

This property holds the spacing between widgets inside the layout.

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

For QGridLayout and QFormLayout, it is possible to set different horizontal and vertical spacings using setHorizontalSpacing() and setVerticalSpacing(). In that case, spacing() returns -1.

new QMetaObject QtGui.QLayout.StaticMetaObject
staticget
QSize QtGui.QLayout.TotalMaximumSize
get
QSize QtGui.QLayout.TotalMinimumSize
get
QSize QtGui.QLayout.TotalSizeHint
get
virtual QWidget QtGui.QLayout.Widget
get

If this item is a QWidget, it is returned as a QWidget; otherwise 0 is returned. This function provides type-safe casting.

virtual EventHandler<QEventArgs<QEvent> > QtGui.QLayout.WidgetEvent
addremove