📄 qsplitter.3qt
字号:
'\" t.TH QSplitter 3qt "10 November 2003" "Trolltech AS" \" -*- nroff -*-.\" Copyright 1992-2001 Trolltech AS. All rights reserved. See the.\" license file included in the distribution for a complete license.\" statement..\".ad l.nh.SH NAMEQSplitter \- Implements a splitter widget.SH SYNOPSIS\fC#include <qsplitter.h>\fR.PPInherits QFrame..PP.SS "Public Members".in +1c.ti -1c.BI "enum \fBResizeMode\fR { Stretch, KeepSize, FollowSizeHint, Auto }".br.ti -1c.BI "\fBQSplitter\fR ( QWidget * parent = 0, const char * name = 0 )".br.ti -1c.BI "\fBQSplitter\fR ( Orientation o, QWidget * parent = 0, const char * name = 0 )".br.ti -1c.BI "\fB~QSplitter\fR ()".br.ti -1c.BI "virtual void \fBsetOrientation\fR ( Orientation )".br.ti -1c.BI "Orientation \fBorientation\fR () const".br.ti -1c.BI "void \fBsetChildrenCollapsible\fR ( bool )".br.ti -1c.BI "bool \fBchildrenCollapsible\fR () const".br.ti -1c.BI "void \fBsetCollapsible\fR ( QWidget * w, bool collapse )".br.ti -1c.BI "virtual void \fBsetResizeMode\fR ( QWidget * w, ResizeMode mode )".br.ti -1c.BI "virtual void \fBsetOpaqueResize\fR ( bool = TRUE )".br.ti -1c.BI "bool \fBopaqueResize\fR () const".br.ti -1c.BI "void \fBmoveToFirst\fR ( QWidget * w )".br.ti -1c.BI "void \fBmoveToLast\fR ( QWidget * w )".br.ti -1c.BI "void \fBrefresh\fR ()".br.ti -1c.BI "QValueList<int> \fBsizes\fR () const".br.ti -1c.BI "void \fBsetSizes\fR ( QValueList<int> list )".br.ti -1c.BI "int \fBhandleWidth\fR () const".br.ti -1c.BI "void \fBsetHandleWidth\fR ( int )".br.in -1c.SS "Properties".in +1c.ti -1c.BI "bool \fBchildrenCollapsible\fR - whether child widgets can be resized down to size 0 by the user".br.ti -1c.BI "int \fBhandleWidth\fR - the width of the splitter handle".br.ti -1c.BI "bool \fBopaqueResize\fR - whether resizing is opaque".br.ti -1c.BI "Orientation \fBorientation\fR - the orientation of the splitter".br.in -1c.SS "Protected Members".in +1c.ti -1c.BI "virtual void \fBchildEvent\fR ( QChildEvent * c )".br.ti -1c.BI "int \fBidAfter\fR ( QWidget * w ) const".br.ti -1c.BI "void \fBmoveSplitter\fR ( QCOORD p, int id )".br.ti -1c.BI "virtual void drawSplitter ( QPainter * p, QCOORD x, QCOORD y, QCOORD w, QCOORD h ) \fI(obsolete)\fR".br.ti -1c.BI "int \fBadjustPos\fR ( int pos, int id )".br.ti -1c.BI "virtual void \fBsetRubberband\fR ( int p )".br.ti -1c.BI "void \fBgetRange\fR ( int id, int * min, int * max )".br.in -1c.SH RELATED FUNCTION DOCUMENTATION.in +1c.ti -1c.BI "QTextStream & \fBoperator<<\fR ( QTextStream & ts, const QSplitter & splitter )".br.ti -1c.BI "QTextStream & \fBoperator>>\fR ( QTextStream & ts, QSplitter & splitter )".br.in -1c.SH DESCRIPTIONThe QSplitter class implements a splitter widget..PPA 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..PPTo show a QListBox, a QListView and a QTextEdit side by side:.PP.nf.br QSplitter *split = new QSplitter( parent );.br QListBox *lb = new QListBox( split );.br QListView *lv = new QListView( split );.br QTextEdit *ed = new QTextEdit( split );.br.fi.PPQSplitter lays out its children horizontally (side by side); you can use setOrientation(QSplitter::Vertical) to lay out the children vertically..PPBy 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..PPAlthough 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..PPThe 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..PPIf 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()..PP.ce 1.B "[Image Omitted]".PP.ce 1.B "[Image Omitted]".PPSee also QTabBar and Organizers..SS "Member Type Documentation".SH "QSplitter::ResizeMode"This enum type describes how QSplitter will resize each of its child widgets..TP\fCQSplitter::Auto\fR - The widget will be resized according to the stretch factors set in its sizePolicy()..TP\fCQSplitter::Stretch\fR - The widget will be resized when the splitter itself is resized..TP\fCQSplitter::KeepSize\fR - QSplitter will try to keep the widget's size unchanged..TP\fCQSplitter::FollowSizeHint\fR - QSplitter will resize the widget when the widget's size hint changes..SH MEMBER FUNCTION DOCUMENTATION.SH "QSplitter::QSplitter ( QWidget * parent = 0, const char * name = 0 )"Constructs a horizontal splitter with the \fIparent\fR and \fIname\fR arguments being passed on to the QFrame constructor..SH "QSplitter::QSplitter ( Orientation o, QWidget * parent = 0, const char * name = 0 )"Constructs a splitter with orientation \fIo\fR with the \fIparent\fR and \fIname\fR arguments being passed on to the QFrame constructor..SH "QSplitter::~QSplitter ()"Destroys the splitter and any children..SH "int QSplitter::adjustPos ( int pos, int id )\fC [protected]\fR"Returns the closest legal position to \fIpos\fR of the widget with ID \fIid\fR..PPSee also idAfter()..SH "void QSplitter::childEvent ( QChildEvent * c )\fC [virtual protected]\fR"Tells the splitter that the child widget described by \fIc\fR has been inserted or removed..PPReimplemented from QObject..SH "bool QSplitter::childrenCollapsible () const"Returns TRUE if child widgets can be resized down to size 0 by the user; otherwise returns FALSE. See the "childrenCollapsible" property for details..SH "void QSplitter::drawSplitter ( QPainter * p, QCOORD x, QCOORD y, QCOORD w, QCOORD h )\fC [virtual protected]\fR"\fBThis function is obsolete.\fR It is provided to keep old source working. We strongly advise against using it in new code..PPDraws the splitter handle in the rectangle described by \fIx\fR, \fIy\fR, \fIw\fR, \fIh\fR using painter \fIp\fR..PPSee also QStyle::drawPrimitive()..SH "void QSplitter::getRange ( int id, int * min, int * max )\fC [protected]\fR"Returns the valid range of the splitter with ID \fIid\fR in \fI*min\fR and \fI*max\fR if \fImin\fR and \fImax\fR are not 0..PPSee also idAfter()..SH "int QSplitter::handleWidth () const"Returns the width of the splitter handle. See the "handleWidth" property for details..SH "int QSplitter::idAfter ( QWidget * w ) const\fC [protected]\fR"Returns the ID of the widget to the right of or below the widget \fIw\fR, or 0 if there is no such widget (i.e. it is either not in this QSplitter or \fIw\fR is at the end)..SH "void QSplitter::moveSplitter ( QCOORD p, int id )\fC [protected]\fR"Moves the left/top edge of the splitter handle with ID \fIid\fR as close as possible to position \fIp\fR, which is the distance from the left (or top) edge of the widget..PPFor Arabic, Hebrew and other right-to-left languages the layout is reversed. \fIp\fR is then the distance from the right (or top) edge of the widget..PPSee also idAfter()..SH "void QSplitter::moveToFirst ( QWidget * w )"Moves widget \fIw\fR to the leftmost/top position..PPExample: splitter/splitter.cpp..SH "void QSplitter::moveToLast ( QWidget * w )"Moves widget \fIw\fR to the rightmost/bottom position..SH "bool QSplitter::opaqueResize () const"Returns TRUE if resizing is opaque; otherwise returns FALSE. See the "opaqueResize" property for details..SH "Orientation QSplitter::orientation () const"Returns the orientation of the splitter. See the "orientation" property for details..SH "void QSplitter::refresh ()"Updates the splitter's state. You should not need to call this function..SH "void QSplitter::setChildrenCollapsible ( bool )"Sets whether child widgets can be resized down to size 0 by the user. See the "childrenCollapsible" property for details..SH "void QSplitter::setCollapsible ( QWidget * w, bool collapse )"Sets whether the child widget \fIw\fR is collapsible to \fIcollapse\fR..PPBy 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..PPSee also childrenCollapsible..SH "void QSplitter::setHandleWidth ( int )"Sets the width of the splitter handle. See the "handleWidth" property for details..SH "void QSplitter::setOpaqueResize ( bool = TRUE )\fC [virtual]\fR"Sets whether resizing is opaque. See the "opaqueResize" property for details..SH "void QSplitter::setOrientation ( Orientation )\fC [virtual]\fR"Sets the orientation of the splitter. See the "orientation" property for details..SH "void QSplitter::setResizeMode ( QWidget * w, ResizeMode mode )\fC [virtual]\fR"Sets resize mode of widget \fIw\fR to \fImode\fR. (The default is Auto.).PPExamples:.)l fileiconview/mainwindow.cpp, listviews/listviews.cpp, and splitter/splitter.cpp..SH "void QSplitter::setRubberband ( int p )\fC [virtual protected]\fR"Displays a rubber band at position \fIp\fR. If \fIp\fR is negative, the rubber band is removed..SH "void QSplitter::setSizes ( QValueList<int> list )"Sets the size parameters to the values given in the \fIlist\fR. 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 \fIlist\fR are ignored..PPIf \fIlist\fR contains too few values, the result is undefined but the program will still be well-behaved..PPSee also sizes()..SH "QValueList<int> QSplitter::sizes () const"Returns a list of the size parameters of all the widgets in this splitter..PPIf 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..PPGiving the values to another splitter's setSizes() function will produce a splitter with the same layout as this one..PPNote that if you want to iterate over the list, you should iterate over a copy, e.g..PP.nf.br QValueList<int> list = mySplitter.sizes();.br QValueList<int>::Iterator it = list.begin();.br while( it != list.end() ) {.br myProcessing( *it );.br ++it;.br }.br.fi.PPSee also setSizes()..SS "Property Documentation".SH "bool childrenCollapsible"This property holds whether child widgets can be resized down to size 0 by the user..PPBy default, children are collapsible. It is possible to enable and disable the collapsing of individual children; see setCollapsible()..PPSet this property's value with setChildrenCollapsible() and get this property's value with childrenCollapsible()..SH "int handleWidth"This property holds the width of the splitter handle..PPSet this property's value with setHandleWidth() and get this property's value with handleWidth()..SH "bool opaqueResize"This property holds whether resizing is opaque..PPOpaque resizing is off by default..PPSet this property's value with setOpaqueResize() and get this property's value with opaqueResize()..SH "Orientation orientation"This property holds the orientation of the splitter..PPBy default the orientation is horizontal (the widgets are side by side). The possible orientations are Horizontal and Vertical..PPSet this property's value with setOrientation() and get this property's value with orientation()..SH RELATED FUNCTION DOCUMENTATION.SH "QTextStream & operator<< ( QTextStream & ts, const QSplitter & splitter )"Writes the sizes and the hidden state of the widgets in the splitter \fIsplitter\fR to the text stream \fIts\fR..PPSee also operator>>(), sizes(), and QWidget::hidden..SH "QTextStream & operator>> ( QTextStream & ts, QSplitter & splitter )"Reads the sizes and the hidden state of the widgets in the splitter \fIsplitter\fR from the text stream \fIts\fR. The sizes must have been previously written by the operator<<() function..PPSee also operator<<(), setSizes(), and QWidget::hide()..SH "SEE ALSO".BR http://doc.trolltech.com/qsplitter.html.BR http://www.trolltech.com/faq/tech.html.SH COPYRIGHTCopyright 1992-2001 Trolltech AS, http://www.trolltech.com. See thelicense file included in the distribution for a complete licensestatement..SH AUTHORGenerated automatically from the source code..SH BUGSIf you find a bug in Qt, please report it as described in.BR http://doc.trolltech.com/bughowto.html .Good bug reports help us to help you. Thank you..PThe definitive Qt documentation is provided in HTML format; it islocated at $QTDIR/doc/html and can be read using Qt Assistant or witha web browser. This man page is provided as a convenience for thoseusers who prefer man pages, although this format is not officiallysupported by Trolltech. .PIf you find errors in this manual page, please report them to.BR qt-bugs@trolltech.com .Please include the name of the manual page (qsplitter.3qt) and the Qtversion (3.2.3).
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -