Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions |

# QGridWidget Class Reference

The QGridWidget class provides simple geometry management of its children. More...

    #include <QGridWidget>

Inherits QFrame.

- List of all members, including inherited members
- Compatibility members

### Public Types

- typedef Direction

### Writable Properties

- 5 writable properties inherited from QFrame
- 33 writable properties inherited from QWidget
- 1 writable property inherited from QObject

### Read-Only Properties

- 1 read-only property inherited from QFrame
- 24 read-only properties inherited from QWidget

### Public Functions

- QGridWidget ( int n, QWidget * parent = 0, Qt::WFlags f = 0 )
- QGridWidget ( int n, Qt::Orientation orientation, QWidget * parent = 0, Qt::WFlags f = 0 )
- void setSpacing ( int space )

- 2 public functions inherited from QFrame
- 83 public functions inherited from QWidget
- 24 public functions inherited from QObject
- 2 public functions inherited from QPaintDevice

### Public Slots

- 16 public slots inherited from QWidget
- 1 public slot inherited from QObject

### Signals

- 1 signal inherited from QObject

### Static Public Members

- 4 static public members inherited from QWidget
- 4 static public members inherited from QObject

### Protected Functions

- 44 protected functions inherited from QWidget
- 9 protected functions inherited from QObject

## Detailed Description

The QGridWidget class provides simple geometry management of its children.

The grid places its widgets either in columns or in rows depending on its orientation.

The number of rows or columns is defined in the constructor. All the grid's children will be placed and sized in accordance with their sizeHint() and sizePolicy().

Use setMargin() to add space around the grid itself, and setSpacing() to add space between the widgets.

If you just need a layout (not a widget) use QGridLayout instead.

See also QVBoxWidget and QHBoxWidget.

## Member Type Documentation

### typedef QGridWidget::Direction

## Member Function Documentation

### QGridWidget::QGridWidget ( int n, QWidget * parent = 0, Qt::WFlags f = 0 )

Constructs a grid widget with parent parent. n specifies the number of columns. The widget flags f are passed to the QFrame constructor.

### QGridWidget::QGridWidget ( int n, Qt::Orientation orientation, QWidget * parent = 0, Qt::WFlags f = 0 )

Constructs a grid widget with parent parent. If orientation is `Qt::Horizontal`, n specifies the number of columns. If orientation is `Qt::Vertical`, n specifies the number of rows. The widget flags f are passed to the QFrame constructor.

### void QGridWidget::setSpacing ( int space )

Sets the spacing between the child widgets to space.