QSplitter(3qt)
π QSplitter(3qt) π β splitter widget, but make it make sense
bestie, this is the Qt QSplitter page. it's giving "drag the boundary, resize the children". no cap. π
β¨ NAME β¨
QSplitter β Implements a splitter widget. π
πΈ SYNOPSIS πΈ
#include <qsplitter.h>
Inherits QFrame.
π Public Members π
enum ResizeMode { Stretch, KeepSize, FollowSizeHint, Auto }QSplitter ( QWidget * parent = 0, const char * name = 0 )QSplitter ( Orientation o, QWidget * parent = 0, const char * name = 0 )~QSplitter ()virtual void setOrientation ( Orientation )Orientation orientation () constvoid setChildrenCollapsible ( bool )bool childrenCollapsible () constvoid setCollapsible ( QWidget * w, bool collapse )virtual void setResizeMode ( QWidget * w, ResizeMode mode )virtual void setOpaqueResize ( bool = TRUE )bool opaqueResize () constvoid moveToFirst ( QWidget * w )void moveToLast ( QWidget * w )void refresh ()QValueList<int> sizes () constvoid setSizes ( QValueList<int> list )int handleWidth () constvoid setHandleWidth ( int )
π Properties π
bool childrenCollapsibleβ whether child widgets can be resized down to size 0 by the userint handleWidthβ the width of the splitter handlebool opaqueResizeβ whether resizing is opaqueOrientation orientationβ the orientation of the splitter
π¦ Protected Members π¦
virtual void childEvent ( QChildEvent * c )int idAfter ( QWidget * w ) constvoid moveSplitter ( QCOORD p, int id )virtual void drawSplitter ( QPainter * p, QCOORD x, QCOORD y, QCOORD w, QCOORD h ) (obsolete)int adjustPos ( int pos, int id )virtual void setRubberband ( int p )void getRange ( int id, int * min, int * max )
π RELATED FUNCTION DOCUMENTATION π
QTextStream & operator<< ( QTextStream & ts, const QSplitter & splitter )QTextStream & operator>> ( QTextStream & ts, QSplitter & splitter )
π DESCRIPTION π
Okay so QSplitter is literally the class that implements a splitter widget. periodt.
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 by a single splitter. slay.
To show a QListBox, a QListView and a QTextEdit side by side, you just do this:
QSplitter *split = new QSplitter( parent );
QListBox *lb = new QListBox( split );
QListView *lv = new QListView( split );
QTextEdit *ed = new QTextEdit( split );
QSplitter lays out its children horizontally (side by side); you can use setOrientation(QSplitter::Vertical) to lay out the children vertically.
By default, all widgets can be as large or as small as the user wishes, between the minimumSizeHint() (or minimumSize()) and maximumSize() of the widgets. Use setResizeMode() to specify that a widget should keep its size when the splitter is resized, or set the stretch component of the sizePolicy.
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. lowkey smoother, highkey more work.
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().
[Image Omitted]
[Image Omitted]
See also QTabBar and Organizers.
π§ Member Type Documentation π§
QSplitter::ResizeMode
This enum type describes how QSplitter will resize each of its child widgets.
QSplitter::Autoβ The widget will be resized according to the stretch factors set in itssizePolicy().QSplitter::Stretchβ The widget will be resized when the splitter itself is resized.QSplitter::KeepSizeβQSplitterwill try to keep the widget's size unchanged.QSplitter::FollowSizeHintβQSplitterwill resize the widget when the widget's size hint changes.
π MEMBER FUNCTION DOCUMENTATION π
QSplitter::QSplitter ( QWidget * parent = 0, const char * name = 0 )
Constructs a horizontal splitter with the parent and name arguments being passed on to the QFrame constructor. π
QSplitter::QSplitter ( Orientation o, QWidget * parent = 0, const char * name = 0 )
Constructs a splitter with orientation o with the parent and name arguments being passed on to the QFrame constructor.
QSplitter::~QSplitter ()
Destroys the splitter and any children. rip π
int QSplitter::adjustPos ( int pos, int id ) [protected]
Hands you back the closest legal position to pos for the widget with ID id. it's the "snap to something valid" vibe.
See also idAfter().
void QSplitter::childEvent ( QChildEvent * c ) [virtual protected]
Tells the splitter that the child widget described by c has been inserted or removed. behind-the-scenes gossip channel, fr.
Reimplemented from QObject.
bool QSplitter::childrenCollapsible () const
Returns TRUE if child widgets can be resized down to size 0 by the user; otherwise returns FALSE. peek the "childrenCollapsible" property for the deets.
void QSplitter::drawSplitter ( QPainter * p, QCOORD x, QCOORD y, QCOORD w, QCOORD h ) [virtual protected]
This function is obsolete. It is provided to keep old source working. We strongly advise against using it in new code.
Draws the splitter handle in the rectangle described by x, y, w, h using painter p.
See also QStyle::drawPrimitive().
void QSplitter::getRange ( int id, int * min, int * max ) [protected]
If min and max are not 0, this drops the valid range of the splitter with ID id into *min and *max.
See also idAfter().
int QSplitter::handleWidth () const
Returns the width of the splitter handle. see the "handleWidth" property for details.
int QSplitter::idAfter ( QWidget * w ) const [protected]
Returns the ID of the widget to the right of or below the widget w, or 0 if there is no such widget (i.e. it is either not in this QSplitter or w is at the end).
void QSplitter::moveSplitter ( QCOORD p, int id ) [protected]
Moves the left/top edge of the splitter handle with ID id as close as possible to position p, which is the distance from the left (or top) edge of the widget.
For Arabic, Hebrew and other right-to-left languages the layout is reversed. p is then the distance from the right (or top) edge of the widget.
See also idAfter().
void QSplitter::moveToFirst ( QWidget * w )
Moves widget w to the leftmost/top position.
Example: splitter/splitter.cpp.
void QSplitter::moveToLast ( QWidget * w )
Moves widget w to the rightmost/bottom position.
bool QSplitter::opaqueResize () const
Returns TRUE if resizing is opaque; otherwise returns FALSE. see the "opaqueResize" property for details.
Orientation QSplitter::orientation () const
Returns the orientation of the splitter. see the "orientation" property for details.
void QSplitter::refresh ()
Updates the splitter's state. You should not need to call this function. like, fr, you don't.
void QSplitter::setChildrenCollapsible ( bool )
Sets whether child widgets can be resized down to size 0 by the user. see the "childrenCollapsible" property for details.
void QSplitter::setCollapsible ( QWidget * w, bool collapse )
Sets whether the child widget w is collapsible to collapse.
By default, children are collapsible, meaning that the user can resize them down to size 0, even if they have a non-zero minimumSize() or minimumSizeHint(). This behavior can be changed on a per-widget basis by calling this function, or globally for all the widgets in the splitter by setting the childrenCollapsible property.
See also childrenCollapsible.
void QSplitter::setHandleWidth ( int )
Sets the width of the splitter handle. see the "handleWidth" property for details.
void QSplitter::setOpaqueResize ( bool = TRUE ) [virtual]
Sets whether resizing is opaque. see the "opaqueResize" property for details.
void QSplitter::setOrientation ( Orientation ) [virtual]
Sets the orientation of the splitter. see the "orientation" property for details.
void QSplitter::setResizeMode ( QWidget * w, ResizeMode mode ) [virtual]
Sets resize mode of widget w to mode. (The default is Auto.)
Examples:
void QSplitter::setRubberband ( int p ) [virtual protected]
Displays a rubber band at position p. If p is negative, the rubber band is removed.
void QSplitter::setSizes ( QValueList<int> list )
Sets the size parameters to the values given in the list. If the splitter is horizontal, the values set the widths of each widget going from left to right. If the splitter is vertical, the values set the heights of each widget going from top to bottom. Extra values in the list are ignored.
If list contains too few values, the result is undefined but the program will still be well-behaved. undefined behavior warning, bestie.
Note that the values in list should be the height/width that the widgets should be resized to.
See also sizes().
QValueList<int> QSplitter::sizes () const
Returns a list of the size parameters of all the widgets in this splitter.
If the splitter's orientation is horizontal, the list is a list of widget widths; if the orientation is vertical, the list is a list of widget heights.
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().
π Property Documentation π
bool childrenCollapsible
This property holds whether child widgets can be resized down to size 0 by the user.
By default, children are collapsible. It is possible to enable and disable the collapsing of individual children; see setCollapsible().
Set this property's value with setChildrenCollapsible() and get this property's value with childrenCollapsible().
int handleWidth
This property holds the width of the splitter handle.
Set this property's value with setHandleWidth() and get this property's value with handleWidth().
bool opaqueResize
This property holds whether resizing is opaque.
Opaque resizing is off by default.
Set this property's value with setOpaqueResize() and get this property's value with opaqueResize().
Orientation orientation
This property holds the orientation of the splitter.
By default the orientation is horizontal (the widgets are side by side). The possible orientations are Horizontal and Vertical.
Set this property's value with setOrientation() and get this property's value with orientation().
π RELATED FUNCTION DOCUMENTATION π
QTextStream & operator<< ( QTextStream & ts, const QSplitter & splitter )
Writes the sizes and the hidden state of the widgets in the splitter splitter to the text stream ts.
See also operator>>(), sizes(), and QWidget::hidden.
QTextStream & operator>> ( QTextStream & ts, QSplitter & splitter )β bestie this one reads stuff in π it pulls the sizes and the hidden state of all the widgets inside the splittersplitterstraight outta the text streamts. and here's the tea: those sizes gotta have been written out beforehand by theoperator<<()function, okay? no time-traveling, no making it up as you go, it's giving "read back exactly what you wrote" β¨
fr fr, peepoperator<<(),setSizes(), andQWidget::hide()if you wanna know more π
π SEE ALSO π
π COPYRIGHT π
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. bestie if you want the complete license statement, go read the license file included in the distribution, it's all in there, no cap π
π AUTHOR π
Generated automatically from the source code. yeah. the machine did it. not a single human hand typed this, iconic behavior honestly π€β¨
π BUGS π
okay so if you find a bug in Qt, pls pls pls report it the way they describe at http://doc.trolltech.com/bughowto.html. good bug reports help us help you. thank you bestie, you're doing the lord's work π«Ά
the definitive Qt documentation is in HTML format, it lives at $QTDIR/doc/html and you can read it with Qt Assistant or literally any web browser. this man page? it's a lil convenience for the man-page girlies, but ngl this format is not officially supported by Trolltech. so don't come for them if something's weird, mmkay? π
and if you spot errors in this manual page, report them to qt-bugs@trolltech.com. and pleeease include the name of the manual page (qsplitter.3qt) and the Qt version (3.3.8) or they're gonna be so lost π
that's the whole page bestie, you ate that π go forth and split them widgets, main character energy only. this diva was brought to you by Trolltech AS, dated 2 February 2007, and it's serving QSplitter(3qt) realness. periodt π
π¦ where this page comes from
- fedora 43: qt3-devel-docs 3.3.8b-102.fc43 Β· QPL-1.0 OR GPL-2.0-only OR GPL-3.0-only
- fedora 44: qt3-devel-docs 3.3.8b-103.fc44 Β· QPL-1.0 OR GPL-2.0-only OR GPL-3.0-only
- Copyright 1992-2007 Trolltech ASA. All rights reserved. See the
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms