Qt 4.6: QWidgetItem Class Reference

|  | Home · All Classes · Overviews |

# QWidgetItem Class Reference
[QtGui module]

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

     #include <QWidgetItem>

Inherits QLayoutItem.

- List of all members, including inherited members

## Public Functions

| QWidgetItem ( QWidget * widget )

## Reimplemented Public Functions

virtual Qt::Orientations | expandingDirections () const
virtual QRect | geometry () const
virtual bool | hasHeightForWidth () const
virtual int | heightForWidth ( int w ) const
virtual bool | isEmpty () const
virtual QSize | maximumSize () const
virtual QSize | minimumSize () const
virtual void | setGeometry ( const QRect & rect )
virtual QSize | sizeHint () const
virtual QWidget * | widget ()

- 17 public functions inherited from QLayoutItem

## Detailed Description

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

Normally, you don't need to use this class directly. Qt's built-in layout managers provide the following functions for manipulating widgets in layouts:

Class | Functions
--- | ---
QBoxLayout | addWidget(), insertWidget(), setStretchFactor()
QGridLayout | addWidget()
QStackedLayout | addWidget(), insertWidget(), currentWidget(), setCurrentWidget(), widget()

See also QLayout, QSpacerItem, and QLayoutItem::widget().

## Member Function Documentation

### QWidgetItem::QWidgetItem ( QWidget * widget )

Creates an item containing the given widget.

### Qt::Orientations QWidgetItem::expandingDirections () const `[virtual]`

Reimplemented from QLayoutItem::expandingDirections().

### QRect QWidgetItem::geometry () const `[virtual]`

Reimplemented from QLayoutItem::geometry().

See also setGeometry().

### bool QWidgetItem::hasHeightForWidth () const `[virtual]`

Reimplemented from QLayoutItem::hasHeightForWidth().

### int QWidgetItem::heightForWidth ( int w ) const `[virtual]`

Reimplemented from QLayoutItem::heightForWidth().

### bool QWidgetItem::isEmpty () const `[virtual]`

Reimplemented from QLayoutItem::isEmpty().

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

See also QWidget::isHidden().

### QSize QWidgetItem::maximumSize () const `[virtual]`

Reimplemented from QLayoutItem::maximumSize().

### QSize QWidgetItem::minimumSize () const `[virtual]`

Reimplemented from QLayoutItem::minimumSize().

### void QWidgetItem::setGeometry ( const QRect & rect ) `[virtual]`

Reimplemented from QLayoutItem::setGeometry().

See also geometry().

### QSize QWidgetItem::sizeHint () const `[virtual]`

Reimplemented from QLayoutItem::sizeHint().

### QWidget * QWidgetItem::widget () `[virtual]`

Reimplemented from QLayoutItem::widget().

Returns the widget managed by this item.