|  | Home · Overviews · Examples

# QLayout Class Reference
[com.trolltech.qt.gui module]

The `QLayout` class is the base class of geometry managers. More...

Inherits `QObject` and `QObject`.

Inherited by `QBoxLayout`, `QGridLayout`, and `QStackedLayout`.

## Detailed Description

The `QLayout` class is the base class of geometry managers.

This is an abstract base class inherited by the concrete classes `QBoxLayout`, `QGridLayout`, and `QStackedLayout`.

For users of `QLayout` subclasses or of `QMainWindow` there is seldom any need to use the basic functions provided by `QLayout`, such as `setSizeConstraint` or `setMenuBar`. See Layout Classes for more information.

To make your own layout manager, implement the functions `addItem`, `sizeHint`, `setGeometry`, `itemAt` and `takeAt`. You should also implement `minimumSize` to ensure your layout isn't resized to zero size if there is too little space. To support children whose heights depend on their widths, implement `hasHeightForWidth` and `heightForWidth`. See the Border Layout and Flow Layout examples for more information about implementing custom layout managers.

Geometry management stops when the layout manager is deleted.

See also `QLayoutItem`, Layout Classes, Basic Layouts Example, Border Layout Example, and Flow Layout Example.