|  | Home · All Classes · Modules

# QWidgetItem Class Reference
[QtGui module]

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

Inherits QLayoutItem.

### Methods

- __init__ (self, QWidget)
- Qt.Orientations expandingDirections (self)
- QRect geometry (self)
- bool hasHeightForWidth (self)
- int heightForWidth (self, int)
- bool isEmpty (self)
- QSize maximumSize (self)
- QSize minimumSize (self)
- setGeometry (self, QRect)
- QSize sizeHint (self)
- QWidget widget (self)

## 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().

## Method Documentation

### QWidgetItem.__init__ (self, QWidget)

Creates an item containing the given widget.

### Qt.Orientations QWidgetItem.expandingDirections (self)

Reimplemented from QLayoutItem.expandingDirections().

### QRect QWidgetItem.geometry (self)

Reimplemented from QLayoutItem.geometry().

See also setGeometry().

### bool QWidgetItem.hasHeightForWidth (self)

Reimplemented from QLayoutItem.hasHeightForWidth().

### int QWidgetItem.heightForWidth (self, int)

Reimplemented from QLayoutItem.heightForWidth().

### bool QWidgetItem.isEmpty (self)

Reimplemented from QLayoutItem.isEmpty().

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

See also QWidget.isHidden().

### QSize QWidgetItem.maximumSize (self)

Reimplemented from QLayoutItem.maximumSize().

### QSize QWidgetItem.minimumSize (self)

Reimplemented from QLayoutItem.minimumSize().

### QWidgetItem.setGeometry (self, QRect)

Reimplemented from QLayoutItem.setGeometry().

See also geometry().

### QSize QWidgetItem.sizeHint (self)

Reimplemented from QLayoutItem.sizeHint().

### QWidget QWidgetItem.widget (self)

Reimplemented from QLayoutItem.widget().

Returns the widget managed by this item.