Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions |
The QSplitter class 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 QTextEdit side by side:
QSplitter *split = new QSplitter( parent ); QListBox *lb = new QListBox( split ); QListView *lv = new QListView( split ); QTextEdit *ed = new QTextEdit( split );
In QSplitter the boundary can be either horizontal or vertical. The default is horizontal (the children are side by side) but 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 also use setMinimumSize() and setMaximumSize() on the children. Use setResizeMode() to specify that a widget should keep its size when the splitter is resized.
Although QSplitter normally resizes the children only at the end of a resize operation, 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. It will be reinstated when you show() it again. It is also possible to reorder the widgets within the splitter using moveToFirst() and moveToLast().
See also QTabBar and Organizers.
This enum type describes how QSplitter will resize each of its child widgets. The currently defined values are:
See also idAfter().
Reimplemented from QObject.
Draws the splitter handle in the rectangle described by x, y, w, h using painter p.
See also QStyle::drawPrimitive().
See also idAfter().
For Arabic and Hebrew the layout is reversed, and using this function to set the position of the splitter might lead to unexpected results, since in Arabic and Hebrew the position of splitter one is to the left of the position of splitter zero.
See also idAfter().
Example: splitter/splitter.cpp.
See also setOpaqueResize().
Returns the orientation of the splitter. See the "orientation" property for details.
Updates the splitter's state. You should not need to call this function.
See also opaqueResize().
Examples: mainlyQt/editor.cpp and splitter/splitter.cpp.
Sets the orientation of the splitter. See the "orientation" property for details.
See also ResizeMode.
Examples: fileiconview/mainwindow.cpp, listviews/listviews.cpp, network/ftpclient/ftpmainwindow.cpp and splitter/splitter.cpp.
If list contains too few values, the result is undefined but the program will still be well-behaved.
See also sizes().
Giving the values to another splitter's setSizes() function will produce a splitter with the same layout as this one.
Note that if you want to iterate over the list, you should iterate over a copy, e.g.
QValueList<int> list = mySplitter.sizes(); QValueList<int>::Iterator it = list.begin(); while( it != list.end() ) { myProcessing( *it ); ++it; }
See also setSizes().
This property holds the orientation of the splitter.
By default the orientation is horizontal (the widgets are side by side). The possible orientations are Qt:Vertical and Qt::Horizontal (the default).
Set this property's value with setOrientation() and get this property's value with orientation().
This file is part of the Qt toolkit. Copyright © 1995-2002 Trolltech. All Rights Reserved.
Copyright © 2002 Trolltech | Trademarks | Qt version 3.0.5
|