Qt 4.8
|
The QSpacerItem class provides blank space in a layout. More...
#include <qlayoutitem.h>
Public Functions | |
void | changeSize (int w, int h, QSizePolicy::Policy hData=QSizePolicy::Minimum, QSizePolicy::Policy vData=QSizePolicy::Minimum) |
Changes this spacer item to have preferred width w, preferred height h, horizontal size policy hPolicy and vertical size policy vPolicy. More... | |
Qt::Orientations | expandingDirections () const |
Reimplemented Function More... | |
QRect | geometry () const |
Reimplemented Function More... | |
bool | isEmpty () const |
Returns true. More... | |
QSize | maximumSize () const |
Reimplemented Function More... | |
QSize | minimumSize () const |
Reimplemented Function More... | |
QSpacerItem (int w, int h, QSizePolicy::Policy hData=QSizePolicy::Minimum, QSizePolicy::Policy vData=QSizePolicy::Minimum) | |
Constructs a spacer item with preferred width w, preferred height h, horizontal size policy hPolicy and vertical size policy vPolicy. More... | |
void | setGeometry (const QRect &) |
Reimplemented Function More... | |
QSize | sizeHint () const |
Reimplemented Function More... | |
QSpacerItem * | spacerItem () |
Returns a pointer to this object. More... | |
Public Functions inherited from QLayoutItem | |
Qt::Alignment | alignment () const |
Returns the alignment of this item. More... | |
QSizePolicy::ControlTypes | controlTypes () const |
Returns the control type(s) for the layout item. More... | |
virtual bool | hasHeightForWidth () const |
Returns true if this layout's preferred height depends on its width; otherwise returns false. More... | |
virtual int | heightForWidth (int) const |
Returns the preferred height for this layout item, given the width w. More... | |
virtual void | invalidate () |
Invalidates any cached information in this layout item. More... | |
virtual QLayout * | layout () |
If this item is a QLayout, it is returned as a QLayout; otherwise 0 is returned. More... | |
virtual int | minimumHeightForWidth (int) const |
Returns the minimum height this widget needs for the given width, w. More... | |
QLayoutItem (Qt::Alignment alignment=0) | |
Constructs a layout item with an alignment. More... | |
void | setAlignment (Qt::Alignment a) |
Sets the alignment of this item to alignment. More... | |
virtual QWidget * | widget () |
If this item is a QWidget, it is returned as a QWidget; otherwise 0 is returned. More... | |
virtual | ~QLayoutItem () |
Destroys the QLayoutItem. More... | |
Properties | |
int | height |
QRect | rect |
QSizePolicy | sizeP |
int | width |
Additional Inherited Members | |
Protected Variables inherited from QLayoutItem | |
Qt::Alignment | align |
The QSpacerItem class provides blank space in a layout.
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:
Class | Functions |
QHBoxLayout | addSpacing(), addStretch(), insertSpacing(), insertStretch() |
QGridLayout | setRowMinimumHeight(), setRowStretch(), setColumnMinimumWidth(), setColumnStretch() |
Definition at line 96 of file qlayoutitem.h.
|
inline |
Constructs a spacer item with preferred width w, preferred height h, horizontal size policy hPolicy and vertical size policy vPolicy.
The default values provide a gap that is able to stretch if nothing else wants the space.
Definition at line 99 of file qlayoutitem.h.
void QSpacerItem::changeSize | ( | int | w, |
int | h, | ||
QSizePolicy::Policy | hPolicy = QSizePolicy::Minimum , |
||
QSizePolicy::Policy | vPolicy = QSizePolicy::Minimum |
||
) |
Changes this spacer item to have preferred width w, preferred height h, horizontal size policy hPolicy and vertical size policy vPolicy.
The default values provide a gap that is able to stretch if nothing else wants the space.
Note that if changeSize() 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.
Definition at line 311 of file qlayoutitem.cpp.
Referenced by QCalendarWidgetPrivate::_q_yearClicked(), QCalendarWidgetPrivate::_q_yearEditingFinished(), changeSpacerSize(), QBoxLayout::setDirection(), QWizardPrivate::updateLayout(), and QComboBoxPrivateContainer::updateTopBottomMargin().
|
virtual |
Reimplemented Function
Implements QLayoutItem.
Definition at line 595 of file qlayoutitem.cpp.
Referenced by QBoxLayout::setDirection().
|
virtual |
|
virtual |
|
virtual |
Reimplemented Function
Implements QLayoutItem.
Definition at line 655 of file qlayoutitem.cpp.
|
virtual |
Reimplemented Function
Implements QLayoutItem.
Definition at line 634 of file qlayoutitem.cpp.
|
virtual |
|
virtual |
Reimplemented Function
Implements QLayoutItem.
Definition at line 678 of file qlayoutitem.cpp.
Referenced by QBoxLayout::setDirection().
|
virtual |
Returns a pointer to this object.
Reimplemented from QLayoutItem.
Definition at line 368 of file qlayoutitem.cpp.
|
private |
Definition at line 117 of file qlayoutitem.h.
|
private |
Definition at line 119 of file qlayoutitem.h.
|
private |
Definition at line 118 of file qlayoutitem.h.
|
private |
Definition at line 116 of file qlayoutitem.h.