1QSplitter(3qt) QSplitter(3qt)
2
3
4
6 QSplitter - Implements a splitter widget
7
9 #include <qsplitter.h>
10
11 Inherits QFrame.
12
13 Public Members
14 enum ResizeMode { Stretch, KeepSize, FollowSizeHint, Auto }
15 QSplitter ( QWidget * parent = 0, const char * name = 0 )
16 QSplitter ( Orientation o, QWidget * parent = 0, const char * name = 0
17 )
18 ~QSplitter ()
19 virtual void setOrientation ( Orientation )
20 Orientation orientation () const
21 void setChildrenCollapsible ( bool )
22 bool childrenCollapsible () const
23 void setCollapsible ( QWidget * w, bool collapse )
24 virtual void setResizeMode ( QWidget * w, ResizeMode mode )
25 virtual void setOpaqueResize ( bool = TRUE )
26 bool opaqueResize () const
27 void moveToFirst ( QWidget * w )
28 void moveToLast ( QWidget * w )
29 void refresh ()
30 QValueList<int> sizes () const
31 void setSizes ( QValueList<int> list )
32 int handleWidth () const
33 void setHandleWidth ( int )
34
35 Properties
36 bool childrenCollapsible - whether child widgets can be resized down to
37 size 0 by the user
38 int handleWidth - the width of the splitter handle
39 bool opaqueResize - whether resizing is opaque
40 Orientation orientation - the orientation of the splitter
41
42 Protected Members
43 virtual void childEvent ( QChildEvent * c )
44 int idAfter ( QWidget * w ) const
45 void moveSplitter ( QCOORD p, int id )
46 virtual void drawSplitter ( QPainter * p, QCOORD x, QCOORD y, QCOORD w,
47 QCOORD h ) (obsolete)
48 int adjustPos ( int pos, int id )
49 virtual void setRubberband ( int p )
50 void getRange ( int id, int * min, int * max )
51
53 QTextStream & operator<< ( QTextStream & ts, const QSplitter & splitter
54 )
55 QTextStream & operator>> ( QTextStream & ts, QSplitter & splitter )
56
58 The QSplitter class implements a splitter widget.
59
60 A splitter lets the user control the size of child widgets by dragging
61 the boundary between the children. Any number of widgets may be
62 controlled by a single splitter.
63
64 To show a QListBox, a QListView and a QTextEdit side by side:
65
66 QSplitter *split = new QSplitter( parent );
67 QListBox *lb = new QListBox( split );
68 QListView *lv = new QListView( split );
69 QTextEdit *ed = new QTextEdit( split );
70
71 QSplitter lays out its children horizontally (side by side); you can
72 use setOrientation(QSplitter::Vertical) to lay out the children
73 vertically.
74
75 By default, all widgets can be as large or as small as the user wishes,
76 between the minimumSizeHint() (or minimumSize()) and maximumSize() of
77 the widgets. Use setResizeMode() to specify that a widget should keep
78 its size when the splitter is resized, or set the stretch component of
79 the sizePolicy.
80
81 Although QSplitter normally resizes the children only at the end of a
82 resize operation, if you call setOpaqueResize(TRUE) the widgets are
83 resized as often as possible.
84
85 The initial distribution of size between the widgets is determined by
86 the initial size of each widget. You can also use setSizes() to set the
87 sizes of all the widgets. The function sizes() returns the sizes set by
88 the user.
89
90 If you hide() a child its space will be distributed among the other
91 children. It will be reinstated when you show() it again. It is also
92 possible to reorder the widgets within the splitter using moveToFirst()
93 and moveToLast().
94
95 [Image Omitted]
96
97 [Image Omitted]
98
99 See also QTabBar and Organizers.
100
101 Member Type Documentation
103 This enum type describes how QSplitter will resize each of its child
104 widgets.
105
106 QSplitter::Auto - The widget will be resized according to the stretch
107 factors set in its sizePolicy().
108
109 QSplitter::Stretch - The widget will be resized when the splitter
110 itself is resized.
111
112 QSplitter::KeepSize - QSplitter will try to keep the widget's size
113 unchanged.
114
115 QSplitter::FollowSizeHint - QSplitter will resize the widget when the
116 widget's size hint changes.
117
120 Constructs a horizontal splitter with the parent and name arguments
121 being passed on to the QFrame constructor.
122
124 = 0 )
125 Constructs a splitter with orientation o with the parent and name
126 arguments being passed on to the QFrame constructor.
127
129 Destroys the splitter and any children.
130
132 Returns the closest legal position to pos of the widget with ID id.
133
134 See also idAfter().
135
137 Tells the splitter that the child widget described by c has been
138 inserted or removed.
139
140 Reimplemented from QObject.
141
143 Returns TRUE if child widgets can be resized down to size 0 by the
144 user; otherwise returns FALSE. See the "childrenCollapsible" property
145 for details.
146
148 QCOORD h ) [virtual protected]
149 This function is obsolete. It is provided to keep old source working.
150 We strongly advise against using it in new code.
151
152 Draws the splitter handle in the rectangle described by x, y, w, h
153 using painter p.
154
155 See also QStyle::drawPrimitive().
156
158 Returns the valid range of the splitter with ID id in *min and *max if
159 min and max are not 0.
160
161 See also idAfter().
162
164 Returns the width of the splitter handle. See the "handleWidth"
165 property for details.
166
168 Returns the ID of the widget to the right of or below the widget w, or
169 0 if there is no such widget (i.e. it is either not in this QSplitter
170 or w is at the end).
171
173 Moves the left/top edge of the splitter handle with ID id as close as
174 possible to position p, which is the distance from the left (or top)
175 edge of the widget.
176
177 For Arabic, Hebrew and other right-to-left languages the layout is
178 reversed. p is then the distance from the right (or top) edge of the
179 widget.
180
181 See also idAfter().
182
184 Moves widget w to the leftmost/top position.
185
186 Example: splitter/splitter.cpp.
187
189 Moves widget w to the rightmost/bottom position.
190
192 Returns TRUE if resizing is opaque; otherwise returns FALSE. See the
193 "opaqueResize" property for details.
194
196 Returns the orientation of the splitter. See the "orientation" property
197 for details.
198
200 Updates the splitter's state. You should not need to call this
201 function.
202
204 Sets whether child widgets can be resized down to size 0 by the user.
205 See the "childrenCollapsible" property for details.
206
208 Sets whether the child widget w is collapsible to collapse.
209
210 By default, children are collapsible, meaning that the user can resize
211 them down to size 0, even if they have a non-zero minimumSize() or
212 minimumSizeHint(). This behavior can be changed on a per-widget basis
213 by calling this function, or globally for all the widgets in the
214 splitter by setting the childrenCollapsible property.
215
216 See also childrenCollapsible.
217
219 Sets the width of the splitter handle. See the "handleWidth" property
220 for details.
221
223 Sets whether resizing is opaque. See the "opaqueResize" property for
224 details.
225
227 Sets the orientation of the splitter. See the "orientation" property
228 for details.
229
231 Sets resize mode of widget w to mode. (The default is Auto.)
232
233 Examples:
234
236 Displays a rubber band at position p. If p is negative, the rubber band
237 is removed.
238
240 Sets the size parameters to the values given in the list. If the
241 splitter is horizontal, the values set the widths of each widget going
242 from left to right. If the splitter is vertical, the values set the
243 heights of each widget going from top to bottom. Extra values in the
244 list are ignored.
245
246 If list contains too few values, the result is undefined but the
247 program will still be well-behaved.
248
249 Note that the values in list should be the height/width that the
250 widgets should be resized to.
251
252 See also sizes().
253
255 Returns a list of the size parameters of all the widgets in this
256 splitter.
257
258 If the splitter's orientation is horizontal, the list is a list of
259 widget widths; if the orientation is vertical, the list is a list of
260 widget heights.
261
262 Giving the values to another splitter's setSizes() function will
263 produce a splitter with the same layout as this one.
264
265 Note that if you want to iterate over the list, you should iterate over
266 a copy, e.g.
267
268 QValueList<int> list = mySplitter.sizes();
269 QValueList<int>::Iterator it = list.begin();
270 while( it != list.end() ) {
271 myProcessing( *it );
272 ++it;
273 }
274
275 See also setSizes().
276
277 Property Documentation
279 This property holds whether child widgets can be resized down to size 0
280 by the user.
281
282 By default, children are collapsible. It is possible to enable and
283 disable the collapsing of individual children; see setCollapsible().
284
285 Set this property's value with setChildrenCollapsible() and get this
286 property's value with childrenCollapsible().
287
289 This property holds the width of the splitter handle.
290
291 Set this property's value with setHandleWidth() and get this property's
292 value with handleWidth().
293
295 This property holds whether resizing is opaque.
296
297 Opaque resizing is off by default.
298
299 Set this property's value with setOpaqueResize() and get this
300 property's value with opaqueResize().
301
303 This property holds the orientation of the splitter.
304
305 By default the orientation is horizontal (the widgets are side by
306 side). The possible orientations are Horizontal and Vertical.
307
308 Set this property's value with setOrientation() and get this property's
309 value with orientation().
310
313 Writes the sizes and the hidden state of the widgets in the splitter
314 splitter to the text stream ts.
315
316 See also operator>>(), sizes(), and QWidget::hidden.
317
319 Reads the sizes and the hidden state of the widgets in the splitter
320 splitter from the text stream ts. The sizes must have been previously
321 written by the operator<<() function.
322
323 See also operator<<(), setSizes(), and QWidget::hide().
324
325
327 http://doc.trolltech.com/qsplitter.html
328 http://www.trolltech.com/faq/tech.html
329
331 Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the
332 license file included in the distribution for a complete license
333 statement.
334
336 Generated automatically from the source code.
337
339 If you find a bug in Qt, please report it as described in
340 http://doc.trolltech.com/bughowto.html. Good bug reports help us to
341 help you. Thank you.
342
343 The definitive Qt documentation is provided in HTML format; it is
344 located at $QTDIR/doc/html and can be read using Qt Assistant or with a
345 web browser. This man page is provided as a convenience for those users
346 who prefer man pages, although this format is not officially supported
347 by Trolltech.
348
349 If you find errors in this manual page, please report them to qt-
350 bugs@trolltech.com. Please include the name of the manual page
351 (qsplitter.3qt) and the Qt version (3.3.8).
352
353
354
355Trolltech AS 2 February 2007 QSplitter(3qt)