QSplitter implements a splitter widget. More...
#include <qsplitter.h>
Inherits QFrame.
A splitter lets the user control the size of child widgets by dragging the boundary between the children. Any number of widgets may be controlled.
To show a QListBox, a QListView and a QMultiLineEdit side by side:
QSplitter *split = new QSplitter( parent ); QListBox *lb = new QListBox( split ); QListView *lv = new QListView( split ); QMultiLineEdit *ed = new QMultiLineEdit( split );
In QSplitter the boundary can be either horizontal or vertical. The default is horizontal (the children are side by side) and you can use setOrientation( QSplitter::Vertical ) to set it to vertical.
By default, all widgets can be as large or as small as the user wishes, down to minimumSizeHint(). You can naturally use setMinimumSize() and/or setMaximumSize() on the children. Use setResizeMode() to specify that a widget should keep its size when the splitter is resized.
QSplitter normally resizes the children only at the end of a resize operation, but if you call setOpaqueResize( TRUE ), the widgets are resized as often as possible.
The initial distribution of size between the widgets is determined by the initial size of each widget. You can also use setSizes() to set the sizes of all the widgets. The function sizes() returns the sizes set by the user.
If you hide() a child, its space will be distributed among the other children. When you show() it again, it will be reinstated.
See also: QTabBar.
Examples: mainlyQt/editor.cpp splitter/splitter.cpp
Stretch
- the widget will be resized when the splitter
itself is resized.
KeepSize
- QSplitter will try to keep this widget's size
unchanged.
Creates splitter with orientation o.
Creates a horizontal splitter.
Destructs the splitter.
[protected]
Returns the legal position closest to p of the splitter with id id.
See also: idAfter().
[virtual protected]
Tells the splitter that a child widget has been inserted/removed.
Reimplemented from QObject.
[virtual protected]
Draws the splitter handle in the rectangle described by x, y, w, h using painter p.
See also: QStyle::drawSplitter.
[virtual protected]
Reimplemented for internal reasons; the API is not affected.
Reimplemented from QObject.
[protected]
Returns the valid range of the splitter with id id in min and max.
See also: idAfter().
[protected]
Returns the id of the splitter to the right of or below the widget w, or 0 if there is no such splitter. (ie. it is either not in this QSplitter, or it is at the end).
[virtual]
Reimplemented for internal reasons; the API is not affected.
Reimplemented from QWidget.
[protected]
Moves the left/top edge of the splitter handle with id id as close as possible to p which is the distance from the left (or top) edge of the widget.
See also: idAfter().
Moves w to the leftmost/top position.
Examples: splitter/splitter.cpp
Moves w to the rightmost/bottom position.
Returns TRUE if opaque resize is on, FALSE otherwise.
See also: setOpaqueResize().
Returns the orientation (Horizontal
or Vertical)
of the splitter.
See also: setOrientation().
Updates the splitter state. You should not need to call this function during normal use of the splitter.
[virtual]
Sets opaque resize to on. Opaque resize is initially turned off.
See also: opaqueResize().
Examples: mainlyQt/editor.cpp splitter/splitter.cpp
[virtual]
Sets the orientation to o. By default the orientation is horizontal (the widgets are side by side).
See also: orientation().
[virtual]
Sets resize mode of w to mode.
See also: ResizeMode.
Examples: splitter/splitter.cpp
[virtual protected]
Shows a rubber band at position p. If p is negative, the rubber band is removed.
Sets the size parameters to the values given in list. Extra values in list are ignored.
If list contains to few values, the result is undefined but the program will still be well-behaved.
[virtual]
Returns a size based on the child widgets.
Reimplemented from QWidget.
[virtual]
Says that this widget wants to grow in both height and width.
Reimplemented from QWidget.
Returns a list of the size parameters of all the widgets in this splitter.
Giving the values to setSizes() will give a splitter with the same layout as this one.
[virtual protected]
Reimplemented for internal reasons; the API is not affected.
Reimplemented from QWidget.
Search the documentation, FAQ, qt-interest archive and more (uses
www.troll.no):
This file is part of the Qt toolkit, copyright © 1995-99 Troll Tech, all rights reserved.
Copyright İ 1999 Troll Tech | Trademarks | Qt version 2.0.2
|