<class name="QLayoutItem" doc="/** <p>The <a href="QLayoutItem.html#QLayoutItem(com.trolltech.qt.core.Qt.Alignment)"><tt>QLayoutItem</tt></a> class provides an abstract item that a <a href="QLayout.html"><tt>QLayout</tt></a> manipulates.</p> <p>This is used by custom layouts.</p> <p>Pure virtual functions are provided to return information about the layout, including, <a href="QLayoutItem.html#sizeHint()"><tt>sizeHint</tt></a>, <a href="QLayoutItem.html#minimumSize()"><tt>minimumSize</tt></a>, <a href="QLayoutItem.html#maximumSize()"><tt>maximumSize</tt></a> and expanding().</p> <p>The layout's geometry can be set and retrieved with <a href="QLayoutItem.html#setGeometry(com.trolltech.qt.core.QRect)"><tt>setGeometry</tt></a> and <a href="QLayoutItem.html#geometry()"><tt>geometry</tt></a>, and its alignment with <a href="QLayoutItem.html#setAlignment(com.trolltech.qt.core.Qt.Alignment)"><tt>setAlignment</tt></a> and <a href="QLayoutItem.html#alignment()"><tt>alignment</tt></a>.</p> <p><a href="QLayoutItem.html#isEmpty()"><tt>isEmpty</tt></a> returns whether the layout item is empty. If the concrete item is a <a href="QWidget.html"><tt>QWidget</tt></a>, it can be retrieved using <a href="QLayoutItem.html#widget()"><tt>widget</tt></a>. Similarly for <a href="QLayoutItem.html#layout()"><tt>layout</tt></a> and <a href="QLayoutItem.html#spacerItem()"><tt>spacerItem</tt></a>.</p> <p>Some layouts have width and height interdependencies. These can be expressed using <a href="QLayoutItem.html#hasHeightForWidth()"><tt>hasHeightForWidth</tt></a>, <a href="QLayoutItem.html#heightForWidth(int)"><tt>heightForWidth</tt></a>, and <a href="QLayoutItem.html#minimumHeightForWidth(int)"><tt>minimumHeightForWidth</tt></a>. For more explanation see the <i>Qt Quarterly</i> article <a href="http://doc.trolltech.com/qq/qq04-height-for-width.html">Trading Height for Width</tt></a>.</p> @see <a href="QLayout.html"><tt>QLayout</tt></a> */"> <method name="public QLayoutItem(com.trolltech.qt.core.Qt.Alignment alignment)" doc="/** <p>Constructs a layout item with an <tt>alignment</tt>. Not all subclasses support alignment.</p> */"/> <method name="public QLayoutItem()" doc="/** <p>Equivalent to <a href="QLayoutItem.html#QLayoutItem(com.trolltech.qt.core.Qt.Alignment)"><tt>QLayoutItem</tt></a>(0). */"/> <method name="public final com.trolltech.qt.core.Qt.Alignment alignment()" doc="/** <p>Returns the alignment of this item.</p> @see <a href="QLayoutItem.html#setAlignment(com.trolltech.qt.core.Qt.Alignment)"><tt>setAlignment</tt></a> */"/> <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#QLayoutItem(com.trolltech.qt.core.Qt.Alignment)"><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#QLayoutItem(com.trolltech.qt.core.Qt.Alignment)"><tt>QLayoutItem</tt></a> subclasses where it would have a visual effect. Except for <a href="QSpacerItem.html"><tt>QSpacerItem</tt></a>, which provides blank space for layouts, all public Qt classes that inherit <a href="QLayoutItem.html#QLayoutItem(com.trolltech.qt.core.Qt.Alignment)"><tt>QLayoutItem</tt></a> support item alignment.</p> @see <a href="QLayoutItem.html#alignment()"><tt>alignment</tt></a> */"/> <method name="public abstract com.trolltech.qt.core.Qt.Orientations expandingDirections()" doc="/** <p>Returns whether this layout item can make use of more space than <a href="QLayoutItem.html#sizeHint()"><tt>sizeHint</tt></a>. 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.</p> */"/> <method name="public abstract com.trolltech.qt.core.QRect geometry()" doc="/** <p>Returns the rectangle covered by this layout item.</p> @see <a href="QLayoutItem.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="QLayoutItem.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="QLayoutItem.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="QLayoutItem.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 abstract boolean isEmpty()" doc="/** <p>Implemented in subclasses to return whether this item is empty, i.e&#x2e; whether it contains any widgets.</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 abstract com.trolltech.qt.core.QSize maximumSize()" doc="/** <p>Implemented in subclasses to return the maximum size of this item.</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="QLayoutItem.html#heightForWidth(int)"><tt>heightForWidth</tt></a>(<tt>arg__1</tt>).</p> */"/> <method name="public abstract com.trolltech.qt.core.QSize minimumSize()" doc="/** <p>Implemented in subclasses to return the minimum size of this item.</p> */"/> <method name="public abstract void setGeometry(com.trolltech.qt.core.QRect arg__1)" doc="/** <p>Implemented in subclasses to set this item's geometry to <tt>arg__1</tt>.</p> @see <a href="QLayoutItem.html#geometry()"><tt>geometry</tt></a> */"/> <method name="public abstract com.trolltech.qt.core.QSize sizeHint()" doc="/** <p>Implemented in subclasses to return the preferred size of this item.</p> */"/> <method name="public com.trolltech.qt.gui.QSpacerItem spacerItem()" doc="/** <p>If this item is a <a href="QSpacerItem.html"><tt>QSpacerItem</tt></a>, it is returned as a <a href="QSpacerItem.html"><tt>QSpacerItem</tt></a>; otherwise 0 is returned. This function provides type-safe casting.</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> */"/> <method name="protected final com.trolltech.qt.core.Qt.Alignment align()"/> <method name="protected final void setAlign(com.trolltech.qt.core.Qt.Alignment align)"/> </class>