|  | Home · All Classes · All Functions · Overviews

# Qt 3 Support Members for QGridLayout

The following class members are part of the Qt 3 support layer. They are provided to help you port old code to Qt 4. We advise against using them in new code.

- QGridLayout class reference

## Public Functions

| QGridLayout ( QWidget * parent, int nRows, int nCols = 1, int margin = 0, int space = -1, const char * name = 0 )
| QGridLayout ( int nRows, int nCols = 1, int spacing = -1, const char * name = 0 )
| QGridLayout ( QLayout * parentLayout, int nRows = 1, int nCols = 1, int spacing = -1, const char * name = 0 )
void | addColSpacing ( int col, int minsize )
void | addMultiCell ( QLayoutItem * l, int fromRow, int toRow, int fromCol, int toCol, Qt::Alignment align = 0 )
void | addMultiCellLayout ( QLayout * layout, int fromRow, int toRow, int fromCol, int toCol, Qt::Alignment align = 0 )
void | addMultiCellWidget ( QWidget * widget, int fromRow, int toRow, int fromCol, int toCol, Qt::Alignment align = 0 )
void | addRowSpacing ( int row, int minsize )
QRect | cellGeometry ( int row, int column ) const
int | colSpacing ( int col ) const
int | colStretch ( int col ) const
void | expand ( int nRows, int nCols )
int | numCols () const
int | numRows () const
Qt::Corner | origin () const
int | rowSpacing ( int row ) const
void | setColSpacing ( int col, int minSize )
void | setColStretch ( int col, int stretch )
void | setOrigin ( Qt::Corner corner )
void | setRowSpacing ( int row, int minSize )

- 11 public functions inherited from QLayout
- 8 public functions inherited from QObject

## Protected Functions

bool | findWidget ( QWidget * w, int * row, int * column )

- 1 protected function inherited from QLayout
- 1 protected function inherited from QObject

## Member Function Documentation

### QGridLayout::QGridLayout ( QWidget * parent, int nRows, int nCols = 1, int margin = 0, int space = -1, const char * name = 0 )

Constructs a new QGridLayout with nRows rows, nCols columns and parent widget, parent. parent may not be 0. The grid layout is called name.

margin is the number of pixels between the edge of the widget and its managed children. space is the default number of pixels between cells. If space is -1, the value of margin is used.

### QGridLayout::QGridLayout ( int nRows, int nCols = 1, int spacing = -1, const char * name = 0 )

Constructs a new grid with nRows rows and nCols columns. If spacing is -1, this QGridLayout inherits its parent's spacing(); otherwise spacing is used. The grid layout is called name.

You must insert this grid into another layout. You can insert widgets and layouts into this layout at any time, but laying out will not be performed before this is inserted into another layout.

### QGridLayout::QGridLayout ( QLayout * parentLayout, int nRows = 1, int nCols = 1, int spacing = -1, const char * name = 0 )

Constructs a new grid with nRows rows and nCols columns. If spacing is -1, this QGridLayout inherits its parent's spacing(); otherwise spacing is used. The grid layout is called name.

You must insert this grid into another layout. You can insert widgets and layouts into this layout at any time, but laying out will not be performed before this is inserted into another layout.

### void QGridLayout::addColSpacing ( int col, int minsize )

Use addItem(new QSpacerItem(minsize, 0), 0, col) instead.

### void QGridLayout::addMultiCell ( QLayoutItem * l, int fromRow, int toRow, int fromCol, int toCol, Qt::Alignment align = 0 )

Use an addItem() overload that allows you to specify row and column spans instead.

### void QGridLayout::addMultiCellLayout ( QLayout * layout, int fromRow, int toRow, int fromCol, int toCol, Qt::Alignment align = 0 )

Use an addLayout() overload that allows you to specify row and column spans instead.

### void QGridLayout::addMultiCellWidget ( QWidget * widget, int fromRow, int toRow, int fromCol, int toCol, Qt::Alignment align = 0 )

Use an addWidget() overload that allows you to specify row and column spans instead.

### void QGridLayout::addRowSpacing ( int row, int minsize )

Use addItem(new QSpacerItem(0, minsize), row, 0) instead.

### QRect QGridLayout::cellGeometry ( int row, int column ) const

Use cellRect(row, column) instead.

### int QGridLayout::colSpacing ( int col ) const

Use columnSpacing() instead.

See also setColSpacing().

### int QGridLayout::colStretch ( int col ) const

Use columnStretch() instead.

See also setColStretch().

### void QGridLayout::expand ( int nRows, int nCols )

Expands this grid so that it will have nRows rows and nCols columns. Will not shrink the grid. You should not need to call this function because QGridLayout expands automatically as new items are inserted.

### bool QGridLayout::findWidget ( QWidget * w, int * row, int * column ) `[protected]`

Searches for widget w in this layout (not including child layouts). If w is found, it sets `*`row and `*`column to the row and column that the widget occupies and returns true; otherwise returns false.

If the widget spans multiple rows/columns, the top-left cell is returned.

Use indexOf() and getItemPosition() instead.

### int QGridLayout::numCols () const

Use columnCount() instead.

### int QGridLayout::numRows () const

Use rowCount() instead.

### Qt::Corner QGridLayout::origin () const

Use originCorner() instead.

See also setOrigin().

### int QGridLayout::rowSpacing ( int row ) const

Use rowMinimumHeight(row) instead.

See also setRowSpacing().

### void QGridLayout::setColSpacing ( int col, int minSize )

Use setColumnMinimumWidth() instead.

See also colSpacing().

### void QGridLayout::setColStretch ( int col, int stretch )

Use setColumnStretch() instead.

See also colStretch().

### void QGridLayout::setOrigin ( Qt::Corner corner )

Use setOriginCorner(corner) instead.

See also origin().

### void QGridLayout::setRowSpacing ( int row, int minSize )

Use setRowMinimumHeight(row, minSize) instead.

See also rowSpacing().