| |||
| Classes - Annotated - Tree - Functions - Home - Structure | |||
The QLayoutItem class provides an abstract item that a QLayout manipulates. More...
#include <qabstractlayout.h>
Inherited by QSpacerItem, QWidgetItem and QLayout.
For custom layouts.
See also QLayout.
Reimplemented in QSpacerItem, QWidgetItem and QLayout.
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" yet:
MyLayout * mthis = (MyLayout*)this;
int h = calculateHeightForWidth( w );
mthis->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 QSpacerItem, QWidgetItem and QLayout.
Reimplement this function in subclasses that can have children.
Reimplemented in QLayout.
Reimplemented in QSpacerItem, QWidgetItem and QLayout.
Examples: customlayout/border.cpp, customlayout/card.cpp and customlayout/flow.cpp.
Reimplemented in QSpacerItem, QWidgetItem and QLayout.
Examples: customlayout/border.cpp, customlayout/card.cpp and customlayout/flow.cpp.
Reimplemented in QSpacerItem, QWidgetItem and QLayout.
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-2000 Trolltech, all rights reserved.
| Copyright © 2000 Trolltech | Trademarks | Qt version main-beta1
|