The QBoxLayout class specifies child widget geometry. More... More...
#include <qlayout.h>
Inherits QLayout.
Inherited by QHBoxLayout and QVBoxLayout.
Contents are arranged serially, either horizontal or vertical. The contents fill the available space.
A QBoxLayout can contain widgets or other layouts.
QHBoxLayout and QVBoxLayout are convenience classes.
Warning: The current version does not support deletion of child widgets. If you need to remove widgets that are under geometry management, you have to delete the layout manager first.
Examples: pref/pref.cpp layout/layout.cpp
Creates a new QBoxLayout with direction d and main widget parent. parent may not be 0.
border is the number of pixels between the edge of the widget and the managed children. autoBorder is the default number of pixels between adjacent managed children. If autoBorder is -1 the value of border is used.
name is the internal object name
See also: direction().
Examples: layout/layout.cpp
If autoBorder is -1, this QBoxLayout will inherit its parent's defaultBorder(), otherwise autoBorder is used.
You have to insert this box into another layout before using it.
Destroys this box.
Adds layout to the box, with serial stretch factor stretch.
See also: addWidget() and addSpacing().
Examples: pref/pref.cpp layout/layout.cpp widgets/widgets.cpp
Adds a non-stretchable space with size size. QBoxLayout gives default border and spacing. This function adds additional space.
See also: addStretch.
Examples: widgets/widgets.cpp
Adds a stretchable space with zero minimum size and stretch factor stretch.
See also: addSpacing.
Examples: pref/pref.cpp widgets/widgets.cpp
Limits the perpendicular dimension of the box (e.g. height if the box is LeftToRight) to a minimum of size. Other constraints may increase the limit.
See also: addMaxStrut().
Adds widget to the box, with stretch factor stretch and alignment align.
The stretch factor applies only in the direction of the QBoxLayout, and is relative to the other boxes and widgets in this QBoxLayout. Widgets and boxes with higher stretch factor grow more.
If the stretch factor is 0 and nothing else in the QBoxLayout can grow at all, the widget may still grow up to its maximum size.
Alignment is perpendicular to direction(), alignment in the serial direction is done with addStretch().
For horizontal boxes, the possible alignments are
AlignCenter
centers vertically in the box.
AlignTop
aligns to the top border of the box.
AlignBottom
aligns to the bottom border of the box.
For vertical boxes, the possible alignments are
AlignCenter
centers horizontally in the box.
AlignLeft
aligns to the left border of the box.
AlignRight
aligns to the right border of the box.
Alignment only has effect if the size of the box is greater than the widget's maximum size.
See also: addLayout() and addSpacing().
Examples: pref/pref.cpp layout/layout.cpp widgets/widgets.cpp
Returns the (serial) direction of the box. addWidget(), addBox() and addSpacing() works in this direction; the stretch stretches in this direction. Alignment works perpendicular to this direction.
The directions are LeftToRight, RightToLeft, TopToBottom
and BottomToTop.
For the last two, the shorter aliases Down
and
Up
are also available.
See also: addWidget(), addBox() and addSpacing().
[virtual protected]
Initializes this box.
Reimplemented from QLayout.
[virtual protected]
Returns the main horizontal chain, so that a box can be put into other boxes (or other types of QLayout).
Reimplemented from QLayout.
[virtual protected]
Returns the main vertical chain, so that a box can be put into other boxes (or other types of QLayout).
Reimplemented from QLayout.
This file is part of the Qt toolkit, copyright © 1995-97 Troll Tech, all rights reserved.
It was generated from the following files: