File: qsplitter.3qt

package info (click to toggle)
qt-embedded-free 3.0.3-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 91,492 kB
  • ctags: 67,431
  • sloc: cpp: 427,709; ansic: 128,011; sh: 21,353; yacc: 2,874; xml: 2,310; python: 1,863; perl: 481; lex: 453; makefile: 426; sql: 29; lisp: 15
file content (262 lines) | stat: -rw-r--r-- 10,199 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
'\" t
.TH QSplitter 3qt "18 March 2002" "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 NAME
QSplitter \- Implements a splitter widget
.SH SYNOPSIS
\fC#include <qsplitter.h>\fR
.PP
Inherits QFrame.
.PP
.SS "Public Members"
.in +1c
.ti -1c
.BI "enum \fBResizeMode\fR { Stretch, KeepSize, FollowSizeHint }"
.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 "virtual void \fBsetResizeMode\fR ( QWidget * w, ResizeMode mode )"
.br
.ti -1c
.BI "virtual void \fBsetOpaqueResize\fR ( bool on = 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
.in -1c
.SS "Properties"
.in +1c
.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 p, 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 DESCRIPTION
The QSplitter class implements a splitter widget.
.PP
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.
.PP
To 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
.PP
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.
.PP
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.
.PP
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.
.PP
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.
.PP
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().
.PP
.ce 1
.B "[Image Omitted]"
.PP

.ce 1
.B "[Image Omitted]"
.PP
See also QTabBar and Organizers.
.SS "Member Type Documentation"
.SH "QSplitter::ResizeMode"
This enum type describes how QSplitter will resize each of its child widgets. The currently defined values are:
.TP
\fCQSplitter::Stretch\fR - the widget will be resized when the splitter itself is resized.
.TP
\fCQSplitter::KeepSize\fR - QSplitter will try to keep this 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 p, int id )\fC [protected]\fR"
Returns the closest legal position to \fIp\fR of the splitter with id \fIid\fR.
.PP
See also idAfter().
.SH "void QSplitter::childEvent ( QChildEvent * c )\fC [virtual protected]\fR"
Tells the splitter that a child widget has been inserted or removed. The event is passed in \fIc\fR.
.PP
Reimplemented from QObject.
.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.
.PP
Draws the splitter handle in the rectangle described by \fIx\fR, \fIy\fR, \fIw\fR, \fIh\fR using painter \fIp\fR.
.PP
See 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.
.PP
See also idAfter().
.SH "int QSplitter::idAfter ( QWidget * w ) const\fC [protected]\fR"
Returns the id of the splitter to the right of or below the widget \fIw\fR, or 0 if there is no such splitter (i.e. it is either not in this QSplitter or it 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.
.PP
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.
.PP
See also idAfter().
.SH "void QSplitter::moveToFirst ( QWidget * w )"
Moves widget \fIw\fR to the leftmost/top position.
.PP
Example: 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 opaque resize is on; otherwise returns FALSE.
.PP
See also setOpaqueResize().
.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::setOpaqueResize ( bool on = TRUE )\fC [virtual]\fR"
If \fIon\fR is TRUE then opaque resizing is turned on; otherwise opaque resizing is turned off. Opaque resizing is initially turned off.
.PP
See also opaqueResize().
.PP
Example: splitter/splitter.cpp.
.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 \fIw\fR to \fImode\fR.
.PP
See also ResizeMode.
.PP
Examples:
.)l fileiconview/mainwindow.cpp, listviews/listviews.cpp, network/ftpclient/ftpmainwindow.cpp and splitter/splitter.cpp.
.SH "void QSplitter::setRubberband ( int p )\fC [virtual protected]\fR"
Shows 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 \fIlist\fR. If the splitter is horizontal, the values set the sizes from left to right. If it is vertical, the sizes are applied from top to bottom. Extra values in \fIlist\fR are ignored.
.PP
If \fIlist\fR contains too few values, the result is undefined but the program will still be well-behaved.
.PP
See also sizes().
.SH "QValueList<int> QSplitter::sizes () const"
Returns a list of the size parameters of all the widgets in this splitter.
.PP
Giving the values to another splitter's setSizes() function will produce a splitter with the same layout as this one.
.PP
Note 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
.PP
See also setSizes().
.SS "Property Documentation"
.SH "Orientation orientation"
This property holds the orientation of the splitter.
.PP
By default the orientation is horizontal (the widgets are side by side). The possible orientations are Qt:Vertical and Qt::Horizontal (the default).
.PP
Set this property's value with setOrientation() and get this property's value with orientation().

.SH "SEE ALSO"
.BR http://doc.trolltech.com/qsplitter.html
.BR http://www.trolltech.com/faq/tech.html
.SH COPYRIGHT
Copyright 1992-2001 Trolltech AS, http://www.trolltech.com.  See the
license file included in the distribution for a complete license
statement.
.SH AUTHOR
Generated automatically from the source code.
.SH BUGS
If 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.
.P
The definitive Qt documentation is provided in HTML format; it is
located at $QTDIR/doc/html and can be read using Qt Assistant or with
a web browser. This man page is provided as a convenience for those
users who prefer man pages, although this format is not officially
supported by Trolltech. 
.P
If 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 Qt
version (3.0.3).