|  | 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 w)
- 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 w)

Creates an item containing the given widget.

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

### QRect QWidgetItem.geometry (self)

### bool QWidgetItem.hasHeightForWidth (self)

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

### bool QWidgetItem.isEmpty (self)

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

Reimplemented from QLayoutItem.

See also QWidget.isHidden().

### QSize QWidgetItem.maximumSize (self)

### QSize QWidgetItem.minimumSize (self)

### QWidgetItem.setGeometry (self, QRect)

### QSize QWidgetItem.sizeHint (self)

### QWidget QWidgetItem.widget (self)

Returns the widget managed by this item.

Reimplemented from QLayoutItem.