<class name="QSpacerItem" doc="/** <p>The <a href="QSpacerItem.html#QSpacerItem(int, int, com.trolltech.qt.gui.QSizePolicy.Policy, com.trolltech.qt.gui.QSizePolicy.Policy)"><tt>QSpacerItem</tt></a> class provides blank space in a layout.</p> <p>Normally, you don't need to use this class directly. Qt's built-in layout managers provide the following functions for manipulating empty space in layouts:</p> <p><table align="center" cellpadding="2" cellspacing="1" border="0"> <thead><tr valign="top" class="qt-style"><th>Class</th><th>Functions</th></tr></thead> <tr valign="top" class="odd"><td><a href="QHBoxLayout.html"><tt>QHBoxLayout</tt></a></td><td>addSpacing(), addStretch(), insertSpacing(), insertStretch()</td></tr> <tr valign="top" class="even"><td><a href="QGridLayout.html"><tt>QGridLayout</tt></a></td><td>setRowMinimumHeight(), setRowStretch(), setColumnMinimumWidth(), setColumnStretch()</td></tr> </table></p> @see <a href="QLayout.html"><tt>QLayout</tt></a> @see <a href="QWidgetItem.html"><tt>QWidgetItem</tt></a> @see <tt>QLayoutItem::spacerItem</tt> */"> <method name="public QSpacerItem(int w, int h, com.trolltech.qt.gui.QSizePolicy.Policy hData, com.trolltech.qt.gui.QSizePolicy.Policy vData)" doc="/** <p>Constructs a spacer item with preferred width <tt>w</tt>, preferred height <tt>h</tt>, horizontal size policy <tt>hData</tt> and vertical size policy <tt>vData</tt>.</p> <p>The default values provide a gap that is able to stretch if nothing else wants the space.</p> */"/> <method name="public QSpacerItem(int w, int h, com.trolltech.qt.gui.QSizePolicy.Policy hData)" doc="/** <p>Equivalent to <a href="QSpacerItem.html#QSpacerItem(int, int, com.trolltech.qt.gui.QSizePolicy.Policy, com.trolltech.qt.gui.QSizePolicy.Policy)"><tt>QSpacerItem</tt></a>(<tt>w</tt>, <tt>h</tt>, <tt>hData</tt>, QSizePolicy::Minimum). */"/> <method name="public QSpacerItem(int w, int h)" doc="/** <p>Equivalent to <a href="QSpacerItem.html#QSpacerItem(int, int, com.trolltech.qt.gui.QSizePolicy.Policy, com.trolltech.qt.gui.QSizePolicy.Policy)"><tt>QSpacerItem</tt></a>(<tt>w</tt>, <tt>h</tt>, QSizePolicy::Minimum, QSizePolicy::Minimum). */"/> <method name="public final com.trolltech.qt.core.Qt.Alignment alignment()" doc="/** <p>Returns the alignment of this item.</p> @see <a href="QSpacerItem.html#setAlignment(com.trolltech.qt.core.Qt.Alignment)"><tt>setAlignment</tt></a> */"/> <method name="public final void changeSize(int w, int h, com.trolltech.qt.gui.QSizePolicy.Policy hData, com.trolltech.qt.gui.QSizePolicy.Policy vData)" doc="/** <p>Changes this spacer item to have preferred width <tt>w</tt>, preferred height <tt>h</tt>, horizontal size policy <tt>hData</tt> and vertical size policy <tt>vData</tt>.</p> <p>The default values provide a gap that is able to stretch if nothing else wants the space.</p> <p>Note that if <a href="QSpacerItem.html#changeSize(int, int, com.trolltech.qt.gui.QSizePolicy.Policy, com.trolltech.qt.gui.QSizePolicy.Policy)"><tt>changeSize</tt></a> is called after the spacer item has been added to a layout, it is necessary to invalidate the layout in order for the spacer item's new size to take effect.</p> @see <tt>QSpacerItem::invalidate</tt> */"/> <method name="public final void changeSize(int w, int h, com.trolltech.qt.gui.QSizePolicy.Policy hData)" doc="/** <p>Equivalent to <a href="QSpacerItem.html#changeSize(int, int, com.trolltech.qt.gui.QSizePolicy.Policy, com.trolltech.qt.gui.QSizePolicy.Policy)"><tt>changeSize</tt></a>(<tt>w</tt>, <tt>h</tt>, <tt>hData</tt>, QSizePolicy::Minimum). */"/> <method name="public final void changeSize(int w, int h)" doc="/** <p>Equivalent to <a href="QSpacerItem.html#changeSize(int, int, com.trolltech.qt.gui.QSizePolicy.Policy, com.trolltech.qt.gui.QSizePolicy.Policy)"><tt>changeSize</tt></a>(<tt>w</tt>, <tt>h</tt>, QSizePolicy::Minimum, QSizePolicy::Minimum). */"/> <method name="public final com.trolltech.qt.gui.QSizePolicy.ControlTypes controlTypes()" doc="/** <p>Returns the control type(s) for the layout item. For a <a href="QWidgetItem.html"><tt>QWidgetItem</tt></a>, the control type comes from the widget's size policy; for a <a href="QLayoutItem.html"><tt>QLayoutItem</tt></a>, the control types is derived from the layout's contents.</p> @see <tt>QSizePolicy::controlType</tt> */"/> <method name="public final void setAlignment(com.trolltech.qt.core.Qt.Alignment a)" doc="/** <p>Sets the alignment of this item to <tt>a</tt>.</p> <p><b>Note:</b> Item alignment is only supported by <a href="QLayoutItem.html"><tt>QLayoutItem</tt></a> subclasses where it would have a visual effect. Except for <a href="QSpacerItem.html#QSpacerItem(int, int, com.trolltech.qt.gui.QSizePolicy.Policy, com.trolltech.qt.gui.QSizePolicy.Policy)"><tt>QSpacerItem</tt></a>, which provides blank space for layouts, all public Qt classes that inherit <a href="QLayoutItem.html"><tt>QLayoutItem</tt></a> support item alignment.</p> @see <a href="QSpacerItem.html#alignment()"><tt>alignment</tt></a> */"/> <method name="public com.trolltech.qt.core.Qt.Orientations expandingDirections()" doc="/** <p>This function is reimplemented for internal reasons.</p> */"/> <method name="public com.trolltech.qt.core.QRect geometry()" doc="/** <p>This function is reimplemented for internal reasons.</p> @see <a href="QSpacerItem.html#setGeometry(com.trolltech.qt.core.QRect)"><tt>setGeometry</tt></a> */"/> <method name="public boolean hasHeightForWidth()" doc="/** <p>Returns true if this layout's preferred height depends on its width; otherwise returns false. The default implementation returns false.</p> <p>Reimplement this function in layout managers that support height for width.</p> @see <a href="QSpacerItem.html#heightForWidth(int)"><tt>heightForWidth</tt></a> @see <tt>QWidget::heightForWidth</tt> */"/> <method name="public int heightForWidth(int arg__1)" doc="/** <p>Returns the preferred height for this layout item, given the width <tt>arg__1</tt>.</p> <p>The default implementation returns -1, indicating that the preferred height is independent of the width of the item. Using the function <a href="QSpacerItem.html#hasHeightForWidth()"><tt>hasHeightForWidth</tt></a> will typically be much faster than calling this function and testing for -1.</p> <p>Reimplement this function in layout managers that support height for width. A typical implementation will look like this:</p> <pre> int MyLayout::heightForWidth(int w) const { if (cache_dirty || cached_width != w) { <span class="comment">// not all C++ compilers support &quot;mutable&quot;</span> MyLayout *that = (MyLayout*)this; int h = calculateHeightForWidth(w); that-&gt;cached_hfw = h; return h; } return cached_hfw; }</pre> <p>Caching is strongly recommended; without it layout will take exponential time.</p> @see <a href="QSpacerItem.html#hasHeightForWidth()"><tt>hasHeightForWidth</tt></a> */"/> <method name="public void invalidate()" doc="/** <p>Invalidates any cached information in this layout item.</p> */"/> <method name="public boolean isEmpty()" doc="/** <p>Returns true.</p> */"/> <method name="public com.trolltech.qt.gui.QLayout layout()" doc="/** <p>If this item is a <a href="QLayout.html"><tt>QLayout</tt></a>, it is returned as a <a href="QLayout.html"><tt>QLayout</tt></a>; otherwise 0 is returned. This function provides type-safe casting.</p> */"/> <method name="public com.trolltech.qt.core.QSize maximumSize()" doc="/** <p>This function is reimplemented for internal reasons.</p> */"/> <method name="public int minimumHeightForWidth(int arg__1)" doc="/** <p>Returns the minimum height this widget needs for the given width, <tt>arg__1</tt>. The default implementation simply returns <a href="QSpacerItem.html#heightForWidth(int)"><tt>heightForWidth</tt></a>(<tt>arg__1</tt>).</p> */"/> <method name="public com.trolltech.qt.core.QSize minimumSize()" doc="/** <p>This function is reimplemented for internal reasons.</p> */"/> <method name="public void setGeometry(com.trolltech.qt.core.QRect arg__1)" doc="/** <p>This function is reimplemented for internal reasons.</p> @see <a href="QSpacerItem.html#geometry()"><tt>geometry</tt></a> */"/> <method name="public com.trolltech.qt.core.QSize sizeHint()" doc="/** <p>This function is reimplemented for internal reasons.</p> */"/> <method name="public com.trolltech.qt.gui.QSpacerItem spacerItem()" doc="/** <p>Returns a pointer to this object.</p> */"/> <method name="public com.trolltech.qt.gui.QWidget widget()" doc="/** <p>If this item is a <a href="QWidget.html"><tt>QWidget</tt></a>, it is returned as a <a href="QWidget.html"><tt>QWidget</tt></a>; otherwise 0 is returned. This function provides type-safe casting.</p> */"/> </class>