|
| 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.
|
| ~QSpacerItem () |
| Destructor.
|
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.
|
QSize | sizeHint () const override |
| \reimp
|
QSize | minimumSize () const override |
| \reimp
|
QSize | maximumSize () const override |
| \reimp
|
Qt::Orientations | expandingDirections () const override |
| \reimp
|
bool | isEmpty () const override |
| Returns true .
|
void | setGeometry (const QRect &) override |
| \reimp
|
QRect | geometry () const override |
| \reimp
|
QSpacerItem * | spacerItem () override |
| Returns a pointer to this object.
|
QSizePolicy | sizePolicy () const |
| QLayoutItem (Qt::Alignment alignment=Qt::Alignment()) |
| Constructs a layout item with an alignment.
|
virtual | ~QLayoutItem () |
| Destroys the QLayoutItem.
|
virtual bool | hasHeightForWidth () const |
| Returns true if this layout's preferred height depends on its width; otherwise returns false .
|
virtual int | heightForWidth (int) const |
| Returns the preferred height for this layout item, given the width, which is not used in this default implementation.
|
virtual int | minimumHeightForWidth (int) const |
| Returns the minimum height this widget needs for the given width, w.
|
virtual void | invalidate () |
| Invalidates any cached information in this layout item.
|
virtual QWidget * | widget () const |
| If this item manages a QWidget, returns that widget.
|
virtual QLayout * | layout () |
| If this item is a QLayout, it is returned as a QLayout; otherwise \nullptr is returned.
|
Qt::Alignment | alignment () const |
| Returns the alignment of this item.
|
void | setAlignment (Qt::Alignment a) |
| Sets the alignment of this item to alignment.
|
virtual QSizePolicy::ControlTypes | controlTypes () const |
| Returns the control type(s) for the layout item.
|
The QSpacerItem class provides blank space in a layout.
\inmodule QtWidgets
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:
\table \header
- See also
- QLayout, QWidgetItem, QLayoutItem::spacerItem()
Definition at line 57 of file qlayoutitem.h.
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.
- See also
- QSpacerItem::invalidate()
Definition at line 236 of file qlayoutitem.cpp.