CopperSpice API  1.7.2
QSpacerItem Class Reference

The QSpacerItem class provides blank space in a layout. More...

Inheritance diagram for QSpacerItem:
QLayoutItem

Public Methods

 QSpacerItem (int w, int h, QSizePolicy::Policy hPolicy=QSizePolicy::Minimum, QSizePolicy::Policy vPolicy=QSizePolicy::Minimum)
 
void changeSize (int w, int h, QSizePolicy::Policy hPolicy=QSizePolicy::Minimum, QSizePolicy::Policy vPolicy=QSizePolicy::Minimum)
 
Qt::Orientations expandingDirections () const override
 
QRect geometry () const override
 
bool isEmpty () const override
 
QSize maximumSize () const override
 
QSize minimumSize () const override
 
void setGeometry (const QRect &rect) override
 
QSize sizeHint () const override
 
QSizePolicy sizePolicy () const
 
QSpacerItem * spacerItem () override
 
- Public Methods inherited from QLayoutItem
 QLayoutItem (Qt::Alignment alignment=Qt::Alignment ())
 
virtual ~QLayoutItem ()
 
Qt::Alignment alignment () const
 
virtual QSizePolicy::ControlTypes controlTypes () const
 
virtual bool hasHeightForWidth () const
 
virtual int heightForWidth (int width) const
 
virtual void invalidate ()
 
virtual QLayoutlayout ()
 
virtual int minimumHeightForWidth (int width) const
 
void setAlignment (Qt::Alignment alignment)
 
virtual QWidgetwidget ()
 

Detailed Description

The QSpacerItem class provides blank space in a layout.

Normally, you do not need to use this class directly. the CopperSpice built-in layout managers provide the following functions for manipulating empty space in layouts:

ClassFunctions
QHBoxLayoutaddSpacing(), addStretch(), insertSpacing(), insertStretch()
QGridLayoutsetRowMinimumHeight(), setRowStretch(), setColumnMinimumWidth(), setColumnStretch()
See also
QLayout, QWidgetItem, QLayoutItem::spacerItem()

Constructor & Destructor Documentation

QSpacerItem::QSpacerItem ( int  w,
int  h,
QSizePolicy::Policy  hPolicy = QSizePolicy::Minimum,
QSizePolicy::Policy  vPolicy = QSizePolicy::Minimum 
)
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.

Method Documentation

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.

See also
QSpacerItem::invalidate()
Qt::Orientations QSpacerItem::expandingDirections ( ) const
overridevirtual

Reimplemented from QLayoutItem::expandingDirections().

Implements QLayoutItem.

QRect QSpacerItem::geometry ( ) const
overridevirtual

Reimplemented from QLayoutItem::geometry().

See also
setGeometry()

Implements QLayoutItem.

bool QSpacerItem::isEmpty ( ) const
overridevirtual

Reimplemented from QLayoutItem::isEmpty().

Returns true.

Implements QLayoutItem.

QSize QSpacerItem::maximumSize ( ) const
overridevirtual

Reimplemented from QLayoutItem::maximumSize().

Implements QLayoutItem.

QSize QSpacerItem::minimumSize ( ) const
overridevirtual

Reimplemented from QLayoutItem::minimumSize().

Implements QLayoutItem.

void QSpacerItem::setGeometry ( const QRect rect)
overridevirtual

Reimplemented from QLayoutItem::setGeometry().

See also
geometry()

Implements QLayoutItem.

QSize QSpacerItem::sizeHint ( ) const
overridevirtual

Reimplemented from QLayoutItem::sizeHint().

Implements QLayoutItem.

QSizePolicy QSpacerItem::sizePolicy ( ) const
inline

Property documentation pending.

QSpacerItem * QSpacerItem::spacerItem ( )
overridevirtual

Reimplemented from QLayoutItem::spacerItem().

Returns a pointer to this object.

Reimplemented from QLayoutItem.