![]() |
| ||
Classes - Annotated - Tree - Functions - Home - Structure |
The QLayoutItem class provides an abstract item that a QLayout manipulates. More...
#include <qlayout.h>
Inherited by QLayout, QSpacerItem and QWidgetItem.
This is used by custom layouts.
See also QLayout, Widget Appearance and Style and Geometry (Layout) Management.
Reimplemented in QLayout, QSpacerItem and QWidgetItem.
Returns the rectangle covered by this layout item.
Example: customlayout/border.cpp.
Reimplement this function in layout managers that support height for width.
See also heightForWidth() and QWidget::heightForWidth().
Examples: customlayout/border.cpp and customlayout/flow.cpp.
Reimplemented in QGridLayout and QBoxLayout.
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().
Example: customlayout/flow.cpp.
Reimplemented in QGridLayout and QBoxLayout.
Reimplemented in QLayout.
Reimplemented in QLayout, QSpacerItem and QWidgetItem.
Reimplement this function in subclasses that can have children.
Reimplemented in QLayout.
Reimplemented in QLayout, QSpacerItem and QWidgetItem.
Examples: customlayout/border.cpp, customlayout/card.cpp and customlayout/flow.cpp.
Reimplemented in QLayout, QSpacerItem and QWidgetItem.
Examples: customlayout/border.cpp, customlayout/card.cpp and customlayout/flow.cpp.
Reimplemented in QLayout, QSpacerItem and QWidgetItem.
Examples: customlayout/border.cpp, customlayout/card.cpp and customlayout/flow.cpp.
Reimplemented in QSpacerItem, QWidgetItem, QGridLayout and QBoxLayout.
Reimplemented in QWidgetItem.
Search the documentation, FAQ, qt-interest archive and more (uses
www.trolltech.com):
This file is part of the Qt toolkit, copyright © 1995-2001 Trolltech, all rights reserved.
Copyright © 2001 Trolltech | Trademarks | Qt version 3.0.0-beta3
|