CopperSpice API  1.7.2
QWidgetItem Class Reference

The QWidgetItem class is a layout item that represents a widget. More...

Inheritance diagram for QWidgetItem:
QLayoutItem

Public Methods

 QWidgetItem (QWidget *widget)
 
QSizePolicy::ControlTypes controlTypes () const override
 
Qt::Orientations expandingDirections () const override
 
QRect geometry () const override
 
bool hasHeightForWidth () const override
 
int heightForWidth (int width) const override
 
bool isEmpty () const override
 
QSize maximumSize () const override
 
QSize minimumSize () const override
 
void setGeometry (const QRect &rect) override
 
QSize sizeHint () const override
 
virtual QWidgetwidget () override
 
- Public Methods inherited from QLayoutItem
 QLayoutItem (Qt::Alignment alignment=Qt::Alignment ())
 
virtual ~QLayoutItem ()
 
Qt::Alignment alignment () const
 
virtual void invalidate ()
 
virtual QLayoutlayout ()
 
virtual int minimumHeightForWidth (int width) const
 
void setAlignment (Qt::Alignment alignment)
 
virtual QSpacerItemspacerItem ()
 

Detailed Description

The QWidgetItem class is a layout item that represents a widget.

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

ClassFunctions
QBoxLayoutaddWidget(), insertWidget(), setStretchFactor()
QGridLayoutaddWidget()
QStackedLayoutaddWidget(), insertWidget(), currentWidget(), setCurrentWidget(), widget()
See also
QLayout, QSpacerItem, QLayoutItem::widget()

Constructor & Destructor Documentation

QWidgetItem::QWidgetItem ( QWidget widget)
inlineexplicit

Creates an item containing the given widget.

Method Documentation

QSizePolicy::ControlTypes QWidgetItem::controlTypes ( ) const
overridevirtual

Returns the control type(s) for the layout item. For a QWidgetItem, the control type comes from the widget's size policy; for a QLayoutItem, the control types is derived from the layout's contents.

See also
QSizePolicy::controlType()

Reimplemented from QLayoutItem.

Qt::Orientations QWidgetItem::expandingDirections ( ) const
overridevirtual

Reimplemented from QLayoutItem::expandingDirections().

Implements QLayoutItem.

QRect QWidgetItem::geometry ( ) const
overridevirtual

Reimplemented from QLayoutItem::geometry().

See also
setGeometry()

Implements QLayoutItem.

bool QWidgetItem::hasHeightForWidth ( ) const
overridevirtual

Reimplemented from QLayoutItem::hasHeightForWidth().

Reimplemented from QLayoutItem.

int QWidgetItem::heightForWidth ( int  width) const
overridevirtual

Reimplemented from QLayoutItem::heightForWidth().

Reimplemented from QLayoutItem.

bool QWidgetItem::isEmpty ( ) const
overridevirtual

Reimplemented from QLayoutItem::isEmpty().

Returns true if the widget is hidden, otherwise returns false.

See also
QWidget::isHidden()

Implements QLayoutItem.

QSize QWidgetItem::maximumSize ( ) const
overridevirtual

Reimplemented from QLayoutItem::maximumSize().

Implements QLayoutItem.

QSize QWidgetItem::minimumSize ( ) const
overridevirtual

Reimplemented from QLayoutItem::minimumSize().

Implements QLayoutItem.

void QWidgetItem::setGeometry ( const QRect rect)
overridevirtual

Reimplemented from QLayoutItem::setGeometry().

See also
geometry()

Implements QLayoutItem.

QSize QWidgetItem::sizeHint ( ) const
overridevirtual

Reimplemented from QLayoutItem::sizeHint().

Implements QLayoutItem.

QWidget * QWidgetItem::widget ( )
overridevirtual

Reimplemented from QLayoutItem::widget().

Returns the widget managed by this item.

Reimplemented from QLayoutItem.