diff options
Diffstat (limited to 'doc/html/qlayout.html')
-rw-r--r-- | doc/html/qlayout.html | 414 |
1 files changed, 414 insertions, 0 deletions
diff --git a/doc/html/qlayout.html b/doc/html/qlayout.html new file mode 100644 index 0000000..a82449a --- /dev/null +++ b/doc/html/qlayout.html @@ -0,0 +1,414 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/kernel/qabstractlayout.cpp:560 --> +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> +<title>QLayout Class</title> +<style type="text/css"><!-- +fn { margin-left: 1cm; text-indent: -1cm; } +a:link { color: #004faf; text-decoration: none } +a:visited { color: #672967; text-decoration: none } +body { background: #ffffff; color: black; } +--></style> +</head> +<body> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> +<tr bgcolor="#E5E5E5"> +<td valign=center> + <a href="index.html"> +<font color="#004faf">Home</font></a> + | <a href="classes.html"> +<font color="#004faf">All Classes</font></a> + | <a href="mainclasses.html"> +<font color="#004faf">Main Classes</font></a> + | <a href="annotated.html"> +<font color="#004faf">Annotated</font></a> + | <a href="groups.html"> +<font color="#004faf">Grouped Classes</font></a> + | <a href="functions.html"> +<font color="#004faf">Functions</font></a> +</td> +<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QLayout Class Reference</h1> + +<p>The QLayout class is the base class of geometry managers. +<a href="#details">More...</a> +<p><tt>#include <<a href="qlayout-h.html">qlayout.h</a>></tt> +<p>Inherits <a href="qobject.html">QObject</a> and <a href="qlayoutitem.html">QLayoutItem</a>. +<p>Inherited by <a href="qgridlayout.html">QGridLayout</a> and <a href="qboxlayout.html">QBoxLayout</a>. +<p><a href="qlayout-members.html">List of all member functions.</a> +<h2>Public Members</h2> +<ul> +<li class=fn>enum <a href="#ResizeMode-enum"><b>ResizeMode</b></a> { FreeResize, Minimum, Fixed, Auto }</li> +<li class=fn><a href="#QLayout"><b>QLayout</b></a> ( QWidget * parent, int margin = 0, int spacing = -1, const char * name = 0 )</li> +<li class=fn><a href="#QLayout-2"><b>QLayout</b></a> ( QLayout * parentLayout, int spacing = -1, const char * name = 0 )</li> +<li class=fn><a href="#QLayout-3"><b>QLayout</b></a> ( int spacing = -1, const char * name = 0 )</li> +<li class=fn>int <a href="#margin"><b>margin</b></a> () const</li> +<li class=fn>int <a href="#spacing"><b>spacing</b></a> () const</li> +<li class=fn>virtual void <a href="#setMargin"><b>setMargin</b></a> ( int )</li> +<li class=fn>virtual void <a href="#setSpacing"><b>setSpacing</b></a> ( int )</li> +<li class=fn>void <a href="#setResizeMode"><b>setResizeMode</b></a> ( ResizeMode )</li> +<li class=fn>ResizeMode <a href="#resizeMode"><b>resizeMode</b></a> () const</li> +<li class=fn>virtual void <a href="#setMenuBar"><b>setMenuBar</b></a> ( QMenuBar * w )</li> +<li class=fn>QMenuBar * <a href="#menuBar"><b>menuBar</b></a> () const</li> +<li class=fn>QWidget * <a href="#mainWidget"><b>mainWidget</b></a> ()</li> +<li class=fn>bool <a href="#isTopLevel"><b>isTopLevel</b></a> () const</li> +<li class=fn>virtual void <a href="#setAutoAdd"><b>setAutoAdd</b></a> ( bool b )</li> +<li class=fn>bool <a href="#autoAdd"><b>autoAdd</b></a> () const</li> +<li class=fn>virtual void <a href="#invalidate"><b>invalidate</b></a> ()</li> +<li class=fn>bool <a href="#activate"><b>activate</b></a> ()</li> +<li class=fn>void <a href="#add"><b>add</b></a> ( QWidget * w )</li> +<li class=fn>virtual void <a href="#addItem"><b>addItem</b></a> ( QLayoutItem * item ) = 0</li> +<li class=fn>void <a href="#remove"><b>remove</b></a> ( QWidget * widget )</li> +<li class=fn>void <a href="#removeItem"><b>removeItem</b></a> ( QLayoutItem * item )</li> +<li class=fn>virtual QSizePolicy::ExpandData <a href="#expanding"><b>expanding</b></a> () const</li> +<li class=fn>virtual QSize <a href="#minimumSize"><b>minimumSize</b></a> () const</li> +<li class=fn>virtual QSize <a href="#maximumSize"><b>maximumSize</b></a> () const</li> +<li class=fn>virtual void <a href="#setGeometry"><b>setGeometry</b></a> ( const QRect & r ) = 0</li> +<li class=fn>virtual QLayoutIterator <a href="#iterator"><b>iterator</b></a> () = 0</li> +<li class=fn>virtual bool <a href="#isEmpty"><b>isEmpty</b></a> () const</li> +<li class=fn>bool <a href="#supportsMargin"><b>supportsMargin</b></a> () const</li> +<li class=fn>void <a href="#setEnabled"><b>setEnabled</b></a> ( bool enable )</li> +<li class=fn>bool <a href="#isEnabled"><b>isEnabled</b></a> () const</li> +</ul> +<h2>Properties</h2> +<ul> +<li class=fn>int <a href="#margin-prop"><b>margin</b></a> - the width of the outside border of the layout</li> +<li class=fn>ResizeMode <a href="#resizeMode-prop"><b>resizeMode</b></a> - the resize mode of the layout</li> +<li class=fn>int <a href="#spacing-prop"><b>spacing</b></a> - the spacing between widgets inside the layout</li> +</ul> +<h2>Protected Members</h2> +<ul> +<li class=fn>void <a href="#addChildLayout"><b>addChildLayout</b></a> ( QLayout * l )</li> +<li class=fn>void <a href="#deleteAllItems"><b>deleteAllItems</b></a> ()</li> +<li class=fn>void <a href="#setSupportsMargin"><b>setSupportsMargin</b></a> ( bool b )</li> +<li class=fn>QRect <a href="#alignmentRect"><b>alignmentRect</b></a> ( const QRect & r ) const</li> +</ul> +<hr><a name="details"></a><h2>Detailed Description</h2> + + +The QLayout class is the base class of geometry managers. +<p> + +<p> This is an abstract base class inherited by the concrete classes, +<a href="qboxlayout.html">QBoxLayout</a> and <a href="qgridlayout.html">QGridLayout</a>. +<p> For users of QLayout subclasses or of <a href="qmainwindow.html">QMainWindow</a> there is seldom +any need to use the basic functions provided by QLayout, such as +<a href="#setResizeMode">setResizeMode</a>() or <a href="#setMenuBar">setMenuBar</a>(). See the <a href="layout.html">layout + overview page</a> for more information. +<p> To make your own layout manager, subclass <a href="qglayoutiterator.html">QGLayoutIterator</a> and +implement the functions <a href="#addItem">addItem</a>(), <a href="qlayoutitem.html#sizeHint">sizeHint</a>(), <a href="#setGeometry">setGeometry</a>(), and +<a href="#iterator">iterator</a>(). You should also implement <a href="#minimumSize">minimumSize</a>() 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 +<a href="qlayoutitem.html#hasHeightForWidth">hasHeightForWidth</a>() and <a href="qlayoutitem.html#heightForWidth">heightForWidth</a>(). See the <a href="customlayout.html">custom layout page</a> for an in-depth +description. +<p> Geometry management stops when the layout manager is deleted. +<p>See also <a href="appearance.html">Widget Appearance and Style</a> and <a href="geomanagement.html">Layout Management</a>. + +<hr><h2>Member Type Documentation</h2> +<h3 class=fn><a name="ResizeMode-enum"></a>QLayout::ResizeMode</h3> + +<p> The possible values are: +<ul> +<li><tt>QLayout::Auto</tt> - If the main widget is a top-level widget with no +height-for-width (<a href="qlayoutitem.html#hasHeightForWidth">hasHeightForWidth</a>()), this is +the same as <tt>Minimium</tt>; otherwise, this is the +same as <a href="#ResizeMode-enum">FreeResize</a>. +<li><tt>QLayout::Fixed</tt> - The main widget's size is set to <a href="qlayoutitem.html#sizeHint">sizeHint</a>(); it +cannot be resized at all. +<li><tt>QLayout::Minimum</tt> - The main widget's minimum size is set to +<a href="#minimumSize">minimumSize</a>(); it cannot be smaller. +<li><tt>QLayout::FreeResize</tt> - The widget is not constrained. +</ul> +<hr><h2>Member Function Documentation</h2> +<h3 class=fn><a name="QLayout"></a>QLayout::QLayout ( <a href="qwidget.html">QWidget</a> * parent, int margin = 0, int spacing = -1, const char * name = 0 ) +</h3> +Constructs a new top-level QLayout called <em>name</em>, with main +widget <em>parent</em>. <em>parent</em> may not be 0. +<p> The <em>margin</em> is the number of pixels between the edge of the +widget and the managed children. The <em>spacing</em> sets the value of +<a href="#spacing">spacing</a>(), which gives the spacing between the managed widgets. If +<em>spacing</em> is -1 (the default), spacing is set to the value of <em>margin</em>. +<p> There can be only one top-level layout for a widget. It is +returned by <a href="qwidget.html#layout">QWidget::layout</a>() + +<h3 class=fn><a name="QLayout-2"></a>QLayout::QLayout ( <a href="qlayout.html">QLayout</a> * parentLayout, int spacing = -1, const char * name = 0 ) +</h3> +Constructs a new child QLayout called <em>name</em>, and places it +inside <em>parentLayout</em> by using the default placement defined by +<a href="#addItem">addItem</a>(). +<p> If <em>spacing</em> is -1, this QLayout inherits <em>parentLayout</em>'s +<a href="#spacing">spacing</a>(), otherwise the value of <em>spacing</em> is used. + +<h3 class=fn><a name="QLayout-3"></a>QLayout::QLayout ( int spacing = -1, const char * name = 0 ) +</h3> +Constructs a new child QLayout called <em>name</em>. If <em>spacing</em> is +-1, this QLayout inherits its parent's <a href="#spacing">spacing</a>(); otherwise the +value of <em>spacing</em> is used. +<p> This layout has to be inserted into another layout before geometry +management will work. + +<h3 class=fn>bool <a name="activate"></a>QLayout::activate () +</h3> +Redoes the layout for <a href="#mainWidget">mainWidget</a>(). You should generally not need +to call this because it is automatically called at the most +appropriate times. +<p> However, if you set up a QLayout for a visible widget without +resizing that widget, you will need to call this function in order +to lay it out. +<p> <p>See also <a href="qwidget.html#updateGeometry">QWidget::updateGeometry</a>(). + +<p>Examples: <a href="layout-example.html#x538">layout/layout.cpp</a>, <a href="popup-example.html#x1609">popup/popup.cpp</a>, <a href="scrollview-example.html#x630">scrollview/scrollview.cpp</a>, and <a href="sql.html#x2222">sql/overview/form1/main.cpp</a>. +<h3 class=fn>void <a name="add"></a>QLayout::add ( <a href="qwidget.html">QWidget</a> * w ) +</h3> + +<p> Adds widget <em>w</em> to this layout in a manner specific to the +layout. This function uses <a href="#addItem">addItem</a>(). + +<p>Examples: <a href="customlayout-example.html#x1489">customlayout/border.cpp</a> and <a href="customlayout-example.html#x1536">customlayout/main.cpp</a>. +<h3 class=fn>void <a name="addChildLayout"></a>QLayout::addChildLayout ( <a href="qlayout.html">QLayout</a> * l )<tt> [protected]</tt> +</h3> +This function is called from addLayout() functions in subclasses +to add layout <em>l</em> as a sub-layout. + +<h3 class=fn>void <a name="addItem"></a>QLayout::addItem ( <a href="qlayoutitem.html">QLayoutItem</a> * item )<tt> [pure virtual]</tt> +</h3> + +<p> Implemented in subclasses to add an <em>item</em>. How it is added is +specific to each subclass. +<p> The ownership of <em>item</em> is transferred to the layout, and it's +the layout's responsibility to delete it. + +<p>Examples: <a href="customlayout-example.html#x1490">customlayout/border.cpp</a>, <a href="customlayout-example.html#x1511">customlayout/card.cpp</a>, and <a href="customlayout-example.html#x1467">customlayout/flow.cpp</a>. +<p>Reimplemented in <a href="qgridlayout.html#addItem-2">QGridLayout</a> and <a href="qboxlayout.html#addItem">QBoxLayout</a>. +<h3 class=fn><a href="qrect.html">QRect</a> <a name="alignmentRect"></a>QLayout::alignmentRect ( const <a href="qrect.html">QRect</a> & r ) const<tt> [protected]</tt> +</h3> +Returns the rectangle that should be covered when the geometry of +this layout is set to <em>r</em>, provided that this layout supports +<a href="qlayoutitem.html#setAlignment">setAlignment</a>(). +<p> The result is derived from <a href="qlayoutitem.html#sizeHint">sizeHint</a>() and <a href="#expanding">expanding</a>(). It is never +larger than <em>r</em>. + +<h3 class=fn>bool <a name="autoAdd"></a>QLayout::autoAdd () const +</h3> + +<p> Returns TRUE if this layout automatically grabs all new +<a href="#mainWidget">mainWidget</a>()'s new children and adds them as defined by <a href="#addItem">addItem</a>(); +otherwise returns FALSE. This has effect only for top-level +layouts, i.e. layouts that are direct children of their +mainWidget(). +<p> <a href="#autoAdd">autoAdd</a>() is disabled by default. +<p> Note that a top-level layout is not necessarily associated with +the top-level widget. +<p> <p>See also <a href="#setAutoAdd">setAutoAdd</a>(). + +<h3 class=fn>void <a name="deleteAllItems"></a>QLayout::deleteAllItems ()<tt> [protected]</tt> +</h3> +Removes and deletes all items in this layout. + +<h3 class=fn><a href="qsizepolicy.html#ExpandData-enum">QSizePolicy::ExpandData</a> <a name="expanding"></a>QLayout::expanding () const<tt> [virtual]</tt> +</h3> +Returns whether this layout can make use of more space than +<a href="qlayoutitem.html#sizeHint">sizeHint</a>(). A value of <a href="qt.html#Orientation-enum">Vertical</a> or <a href="qt.html#Orientation-enum">Horizontal</a> means that it wants +to grow in only one dimension, whereas <tt>BothDirections</tt> means that +it wants to grow in both dimensions. +<p> The default implementation returns <tt>BothDirections</tt>. + +<p>Examples: <a href="customlayout-example.html#x1491">customlayout/border.cpp</a> and <a href="customlayout-example.html#x1468">customlayout/flow.cpp</a>. +<p>Reimplemented from <a href="qlayoutitem.html#expanding">QLayoutItem</a>. +<p>Reimplemented in <a href="qgridlayout.html#expanding">QGridLayout</a> and <a href="qboxlayout.html#expanding">QBoxLayout</a>. +<h3 class=fn>void <a name="invalidate"></a>QLayout::invalidate ()<tt> [virtual]</tt> +</h3> +Invalidates cached information. Reimplementations must call this. + +<p>Reimplemented from <a href="qlayoutitem.html#invalidate">QLayoutItem</a>. +<p>Reimplemented in <a href="qgridlayout.html#invalidate">QGridLayout</a> and <a href="qboxlayout.html#invalidate">QBoxLayout</a>. +<h3 class=fn>bool <a name="isEmpty"></a>QLayout::isEmpty () const<tt> [virtual]</tt> +</h3> +Returns TRUE if this layout is empty. The default implementation +returns FALSE. + +<p>Reimplemented from <a href="qlayoutitem.html#isEmpty">QLayoutItem</a>. +<h3 class=fn>bool <a name="isEnabled"></a>QLayout::isEnabled () const +</h3> +Returns TRUE if the layout is enabled; otherwise returns FALSE. +<p> <p>See also <a href="#setEnabled">setEnabled</a>(). + +<h3 class=fn>bool <a name="isTopLevel"></a>QLayout::isTopLevel () const +</h3> + +<p> Returns TRUE if this layout is a top-level layout, i.e. not a +child of another layout; otherwise returns FALSE. + +<h3 class=fn><a href="qlayoutiterator.html">QLayoutIterator</a> <a name="iterator"></a>QLayout::iterator ()<tt> [pure virtual]</tt> +</h3> + +<p> Implemented in subclasses to return an iterator that iterates over +this layout's children. +<p> A typical implementation will be: +<pre> + QLayoutIterator MyLayout::iterator() + { + <a href="qglayoutiterator.html">QGLayoutIterator</a> *i = new MyLayoutIterator( internal_data ); + return QLayoutIterator( i ); + } + </pre> + +where MyLayoutIterator is a subclass of <a href="qglayoutiterator.html">QGLayoutIterator</a>. + +<p>Examples: <a href="customlayout-example.html#x1492">customlayout/border.cpp</a>, <a href="customlayout-example.html#x1512">customlayout/card.cpp</a>, and <a href="customlayout-example.html#x1469">customlayout/flow.cpp</a>. +<p>Reimplemented from <a href="qlayoutitem.html#iterator">QLayoutItem</a>. +<h3 class=fn><a href="qwidget.html">QWidget</a> * <a name="mainWidget"></a>QLayout::mainWidget () +</h3> +Returns the main widget (parent widget) of this layout, or 0 if +this layout is a sub-layout that is not yet inserted. + +<h3 class=fn>int <a name="margin"></a>QLayout::margin () const +</h3><p>Returns the width of the outside border of the layout. +See the <a href="qlayout.html#margin-prop">"margin"</a> property for details. +<h3 class=fn><a href="qsize.html">QSize</a> <a name="maximumSize"></a>QLayout::maximumSize () const<tt> [virtual]</tt> +</h3> +Returns the maximum size of this layout. This is the largest size +that the layout can have while still respecting the +specifications. Does not include what's needed by <a href="#margin">margin</a>() or +<a href="#menuBar">menuBar</a>(). +<p> The default implementation allows unlimited resizing. + +<p>Reimplemented from <a href="qlayoutitem.html#maximumSize">QLayoutItem</a>. +<p>Reimplemented in <a href="qgridlayout.html#maximumSize">QGridLayout</a> and <a href="qboxlayout.html#maximumSize">QBoxLayout</a>. +<h3 class=fn><a href="qmenubar.html">QMenuBar</a> * <a name="menuBar"></a>QLayout::menuBar () const +</h3> + +<p> Returns the menu bar set for this layout, or 0 if no menu bar is +set. + +<h3 class=fn><a href="qsize.html">QSize</a> <a name="minimumSize"></a>QLayout::minimumSize () const<tt> [virtual]</tt> +</h3> +Returns the minimum size of this layout. This is the smallest size +that the layout can have while still respecting the +specifications. Does not include what's needed by <a href="#margin">margin</a>() or +<a href="#menuBar">menuBar</a>(). +<p> The default implementation allows unlimited resizing. + +<p>Examples: <a href="customlayout-example.html#x1493">customlayout/border.cpp</a>, <a href="customlayout-example.html#x1513">customlayout/card.cpp</a>, and <a href="customlayout-example.html#x1470">customlayout/flow.cpp</a>. +<p>Reimplemented from <a href="qlayoutitem.html#minimumSize">QLayoutItem</a>. +<p>Reimplemented in <a href="qgridlayout.html#minimumSize">QGridLayout</a> and <a href="qboxlayout.html#minimumSize">QBoxLayout</a>. +<h3 class=fn>void <a name="remove"></a>QLayout::remove ( <a href="qwidget.html">QWidget</a> * widget ) +</h3> +Removes the widget <em>widget</em> 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. +<p> <p>See also <a href="#removeItem">removeItem</a>(), <a href="qwidget.html#geometry-prop">QWidget::geometry</a>, and <a href="#add">add</a>(). + +<h3 class=fn>void <a name="removeItem"></a>QLayout::removeItem ( <a href="qlayoutitem.html">QLayoutItem</a> * item ) +</h3> +Removes the layout item <em>item</em> from the layout. It is the +caller's responsibility to delete the item. +<p> Notice that <em>item</em> can be a layout (since QLayout inherits +<a href="qlayoutitem.html">QLayoutItem</a>). +<p> <p>See also <a href="#remove">remove</a>() and <a href="#addItem">addItem</a>(). + +<h3 class=fn><a href="qlayout.html#ResizeMode-enum">ResizeMode</a> <a name="resizeMode"></a>QLayout::resizeMode () const +</h3><p>Returns the resize mode of the layout. +See the <a href="qlayout.html#resizeMode-prop">"resizeMode"</a> property for details. +<h3 class=fn>void <a name="setAutoAdd"></a>QLayout::setAutoAdd ( bool b )<tt> [virtual]</tt> +</h3> +If <em>b</em> is TRUE, auto-add is enabled; otherwise auto-add is +disabled. +<p> <b>Warning:</b> If auto-add is enabled, you cannot set stretch factors +on the child widgets until the widgets are actually inserted in +the layout (after control returned to the event loop). We +therefore recommend that you avoid the auto-add feature in new +programs. +<p> <p>See also <a href="#autoAdd">autoAdd</a>(). + +<p>Examples: <a href="qaxserver-example-hierarchy.html#x2649">hierarchy/objects.cpp</a> and <a href="i18n-example.html#x1938">i18n/main.cpp</a>. +<h3 class=fn>void <a name="setEnabled"></a>QLayout::setEnabled ( bool enable ) +</h3> +Enables this layout if <em>enable</em> is TRUE, otherwise disables it. +<p> An enabled layout adjusts dynamically to changes; a disabled +layout acts as if it did not exist. +<p> By default all layouts are enabled. +<p> <p>See also <a href="#isEnabled">isEnabled</a>(). + +<h3 class=fn>void <a name="setGeometry"></a>QLayout::setGeometry ( const <a href="qrect.html">QRect</a> & r )<tt> [pure virtual]</tt> +</h3> +This function is reimplemented in subclasses to perform layout. +<p> The default implementation maintains the <a href="qlayoutitem.html#geometry">geometry</a>() information +given by rect <em>r</em>. Reimplementors must call this function. + +<p>Examples: <a href="customlayout-example.html#x1494">customlayout/border.cpp</a>, <a href="customlayout-example.html#x1514">customlayout/card.cpp</a>, and <a href="customlayout-example.html#x1471">customlayout/flow.cpp</a>. +<p>Reimplemented from <a href="qlayoutitem.html#setGeometry">QLayoutItem</a>. +<p>Reimplemented in <a href="qgridlayout.html#setGeometry">QGridLayout</a> and <a href="qboxlayout.html#setGeometry">QBoxLayout</a>. +<h3 class=fn>void <a name="setMargin"></a>QLayout::setMargin ( int )<tt> [virtual]</tt> +</h3><p>Sets the width of the outside border of the layout. +See the <a href="qlayout.html#margin-prop">"margin"</a> property for details. +<h3 class=fn>void <a name="setMenuBar"></a>QLayout::setMenuBar ( <a href="qmenubar.html">QMenuBar</a> * w )<tt> [virtual]</tt> +</h3> +Makes the geometry manager take account of the menu bar <em>w</em>. All +child widgets are placed below the bottom edge of the menu bar. +<p> A menu bar does its own geometry management: never do addWidget() +on a <a href="qmenubar.html">QMenuBar</a>. + +<p>Examples: <a href="layout-example.html#x539">layout/layout.cpp</a> and <a href="scrollview-example.html#x631">scrollview/scrollview.cpp</a>. +<h3 class=fn>void <a name="setResizeMode"></a>QLayout::setResizeMode ( <a href="qlayout.html#ResizeMode-enum">ResizeMode</a> ) +</h3><p>Sets the resize mode of the layout. +See the <a href="qlayout.html#resizeMode-prop">"resizeMode"</a> property for details. +<h3 class=fn>void <a name="setSpacing"></a>QLayout::setSpacing ( int )<tt> [virtual]</tt> +</h3><p>Sets the spacing between widgets inside the layout. +See the <a href="qlayout.html#spacing-prop">"spacing"</a> property for details. +<h3 class=fn>void <a name="setSupportsMargin"></a>QLayout::setSupportsMargin ( bool b )<tt> [protected]</tt> +</h3> +Sets the value returned by <a href="#supportsMargin">supportsMargin</a>(). If <em>b</em> is TRUE, +<a href="#margin">margin</a>() handling is implemented by the subclass. If <em>b</em> is +FALSE (the default), QLayout will add margin() around top-level +layouts. +<p> If <em>b</em> is TRUE, margin handling needs to be implemented in +<a href="#setGeometry">setGeometry</a>(), <a href="#maximumSize">maximumSize</a>(), <a href="#minimumSize">minimumSize</a>(), <a href="qlayoutitem.html#sizeHint">sizeHint</a>() and +<a href="qlayoutitem.html#heightForWidth">heightForWidth</a>(). +<p> <p>See also <a href="#supportsMargin">supportsMargin</a>(). + +<h3 class=fn>int <a name="spacing"></a>QLayout::spacing () const +</h3><p>Returns the spacing between widgets inside the layout. +See the <a href="qlayout.html#spacing-prop">"spacing"</a> property for details. +<h3 class=fn>bool <a name="supportsMargin"></a>QLayout::supportsMargin () const +</h3> + +<p> Returns TRUE if this layout supports <a href="#margin-prop">QLayout::margin</a> on +non-top-level layouts; otherwise returns FALSE. +<p> <p>See also <a href="#margin-prop">margin</a>. + +<hr><h2>Property Documentation</h2> +<h3 class=fn>int <a name="margin-prop"></a>margin</h3> +<p>This property holds the width of the outside border of the layout. +<p>For some layout classes this property has an effect only on +top-level layouts; <a href="qboxlayout.html">QBoxLayout</a> and <a href="qgridlayout.html">QGridLayout</a> support margins for +child layouts. The default value is 0. +<p> <p>See also <a href="#spacing-prop">spacing</a>. + +<p>Set this property's value with <a href="#setMargin">setMargin</a>() and get this property's value with <a href="#margin">margin</a>(). +<h3 class=fn><a href="qlayout.html#ResizeMode-enum">ResizeMode</a> <a name="resizeMode-prop"></a>resizeMode</h3> +<p>This property holds the resize mode of the layout. +<p>The default mode is <a href="#ResizeMode-enum">Auto</a>. +<p> <p>See also <a href="#ResizeMode-enum">QLayout::ResizeMode</a>. + +<p>Set this property's value with <a href="#setResizeMode">setResizeMode</a>() and get this property's value with <a href="#resizeMode">resizeMode</a>(). +<h3 class=fn>int <a name="spacing-prop"></a>spacing</h3> +<p>This property holds the spacing between widgets inside the layout. +<p>The default value is -1, which signifies that the layout's spacing +should not override the widget's spacing. +<p> <p>See also <a href="#margin-prop">margin</a>. + +<p>Set this property's value with <a href="#setSpacing">setSpacing</a>() and get this property's value with <a href="#spacing">spacing</a>(). +<!-- eof --> +<hr><p> +This file is part of the <a href="index.html">Qt toolkit</a>. +Copyright © 1995-2007 +<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center> +<table width=100% cellspacing=0 border=0><tr> +<td>Copyright © 2007 +<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a> +<td align=right><div align=right>Qt 3.3.8</div> +</table></div></address></body> +</html> |