CopperSpice API  1.9.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 methods for crearting 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
QRect QSpacerItem::geometry ( ) const
overridevirtual
bool QSpacerItem::isEmpty ( ) const
overridevirtual

Always returns true.

Implements QLayoutItem::isEmpty()

QSize QSpacerItem::maximumSize ( ) const
overridevirtual
QSize QSpacerItem::minimumSize ( ) const
overridevirtual
void QSpacerItem::setGeometry ( const QRect rect)
overridevirtual
QSize QSpacerItem::sizeHint ( ) const
overridevirtual
QSizePolicy QSpacerItem::sizePolicy ( ) const
inline

Returns the value of the property.

QSpacerItem * QSpacerItem::spacerItem ( )
overridevirtual

Returns a pointer to this object.

Reimplemented from QLayoutItem::spacerItem()