~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to doc/html/qsplitter.html

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-08-24 04:09:09 UTC
  • Revision ID: james.westby@ubuntu.com-20050824040909-xmxe9jfr4a0w5671
Tags: upstream-4.0.0
ImportĀ upstreamĀ versionĀ 4.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="iso-8859-1"?>
 
2
<!DOCTYPE html
 
3
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
 
4
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 
5
<!-- /tmp/qt-4.0.0-espenr-1119621036935/qt-x11-opensource-desktop-4.0.0/src/gui/widgets/qsplitter.cpp -->
 
6
<head>
 
7
    <title>Qt 4.0: QSplitter Class Reference</title>
 
8
    <style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
 
9
a:link { color: #004faf; text-decoration: none }
 
10
a:visited { color: #672967; text-decoration: none }
 
11
td.postheader { font-family: sans-serif }
 
12
tr.address { font-family: sans-serif }
 
13
body { background: #ffffff; color: black; }</style>
 
14
</head>
 
15
<body>
 
16
<table border="0" cellpadding="0" cellspacing="0" width="100%">
 
17
<tr>
 
18
<td align="left" valign="top" width="32"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></td>
 
19
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a>&nbsp;&middot; <a href="annotated.html"><font color="#004faf">Annotated</font></a>&nbsp;&middot; <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
 
20
<td align="right" valign="top" width="230"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></td></tr></table><h1 align="center">QSplitter Class Reference</h1>
 
21
<p>The QSplitter class implements a splitter widget. <a href="#details">More...</a></p>
 
22
<pre>#include &lt;QSplitter&gt;</pre><p>Part of the <a href="qtgui.html">QtGui</a> module.</p>
 
23
<p>Inherits <a href="qframe.html">QFrame</a>.</p>
 
24
<ul>
 
25
<li><a href="qsplitter-members.html">List of all members, including inherited members</a></li>
 
26
<li><a href="qsplitter-obsolete.html">Obsolete members</a></li>
 
27
<li><a href="qsplitter-qt3.html">Qt 3 support members</a></li>
 
28
</ul>
 
29
<a name="properties"></a>
 
30
<h3>Properties</h3>
 
31
<ul>
 
32
<li><div class="fn"/><b><a href="qsplitter.html#childrenCollapsible-prop">childrenCollapsible</a></b> : bool</li>
 
33
<li><div class="fn"/><b><a href="qsplitter.html#handleWidth-prop">handleWidth</a></b> : int</li>
 
34
<li><div class="fn"/><b><a href="qsplitter.html#opaqueResize-prop">opaqueResize</a></b> : bool</li>
 
35
<li><div class="fn"/><b><a href="qsplitter.html#orientation-prop">orientation</a></b> : Qt::Orientation</li>
 
36
</ul>
 
37
<ul>
 
38
<li><div class="fn"/>6 properties inherited from <a href="qframe.html#properties">QFrame</a></li>
 
39
<li><div class="fn"/>52 properties inherited from <a href="qwidget.html#properties">QWidget</a></li>
 
40
<li><div class="fn"/>1 property inherited from <a href="qobject.html#properties">QObject</a></li>
 
41
</ul>
 
42
<a name="public-functions"></a>
 
43
<h3>Public Functions</h3>
 
44
<ul>
 
45
<li><div class="fn"/><b><a href="qsplitter.html#QSplitter">QSplitter</a></b> ( QWidget * <i>parent</i> = 0 )</li>
 
46
<li><div class="fn"/><b><a href="qsplitter.html#QSplitter-2">QSplitter</a></b> ( Qt::Orientation <i>orientation</i>, QWidget * <i>parent</i> = 0 )</li>
 
47
<li><div class="fn"/><b><a href="qsplitter.html#dtor.QSplitter">~QSplitter</a></b> ()</li>
 
48
<li><div class="fn"/>void <b><a href="qsplitter.html#addWidget">addWidget</a></b> ( QWidget * <i>widget</i> )</li>
 
49
<li><div class="fn"/>bool <b><a href="qsplitter.html#childrenCollapsible-prop">childrenCollapsible</a></b> () const</li>
 
50
<li><div class="fn"/>int <b><a href="qsplitter.html#count">count</a></b> () const</li>
 
51
<li><div class="fn"/>void <b><a href="qsplitter.html#getRange">getRange</a></b> ( int <i>index</i>, int * <i>min</i>, int * <i>max</i> ) const</li>
 
52
<li><div class="fn"/>QSplitterHandle * <b><a href="qsplitter.html#handle">handle</a></b> ( int <i>index</i> ) const</li>
 
53
<li><div class="fn"/>int <b><a href="qsplitter.html#handleWidth-prop">handleWidth</a></b> () const</li>
 
54
<li><div class="fn"/>int <b><a href="qsplitter.html#indexOf">indexOf</a></b> ( QWidget * <i>widget</i> ) const</li>
 
55
<li><div class="fn"/>void <b><a href="qsplitter.html#insertWidget">insertWidget</a></b> ( int <i>index</i>, QWidget * <i>widget</i> )</li>
 
56
<li><div class="fn"/>bool <b><a href="qsplitter.html#isCollapsible">isCollapsible</a></b> ( int <i>index</i> ) const</li>
 
57
<li><div class="fn"/>bool <b><a href="qsplitter.html#opaqueResize-prop">opaqueResize</a></b> () const</li>
 
58
<li><div class="fn"/>Qt::Orientation <b><a href="qsplitter.html#orientation-prop">orientation</a></b> () const</li>
 
59
<li><div class="fn"/>void <b><a href="qsplitter.html#refresh">refresh</a></b> ()</li>
 
60
<li><div class="fn"/>bool <b><a href="qsplitter.html#restoreState">restoreState</a></b> ( const QByteArray &amp; <i>state</i> )</li>
 
61
<li><div class="fn"/>QByteArray <b><a href="qsplitter.html#saveState">saveState</a></b> () const</li>
 
62
<li><div class="fn"/>void <b><a href="qsplitter.html#childrenCollapsible-prop">setChildrenCollapsible</a></b> ( bool )</li>
 
63
<li><div class="fn"/>void <b><a href="qsplitter.html#setCollapsible">setCollapsible</a></b> ( int <i>index</i>, bool <i>collapse</i> )</li>
 
64
<li><div class="fn"/>void <b><a href="qsplitter.html#handleWidth-prop">setHandleWidth</a></b> ( int )</li>
 
65
<li><div class="fn"/>void <b><a href="qsplitter.html#opaqueResize-prop">setOpaqueResize</a></b> ( bool <i>opaque</i> = true )</li>
 
66
<li><div class="fn"/>void <b><a href="qsplitter.html#orientation-prop">setOrientation</a></b> ( Qt::Orientation )</li>
 
67
<li><div class="fn"/>void <b><a href="qsplitter.html#setSizes">setSizes</a></b> ( const QList&lt;int&gt; &amp; <i>list</i> )</li>
 
68
<li><div class="fn"/>void <b><a href="qsplitter.html#setStretchFactor">setStretchFactor</a></b> ( int <i>index</i>, int <i>stretch</i> )</li>
 
69
<li><div class="fn"/>QList&lt;int&gt; <b><a href="qsplitter.html#sizes">sizes</a></b> () const</li>
 
70
<li><div class="fn"/>QWidget * <b><a href="qsplitter.html#widget">widget</a></b> ( int <i>index</i> ) const</li>
 
71
</ul>
 
72
<ul>
 
73
<li><div class="fn"/>13 public functions inherited from <a href="qframe.html#public-functions">QFrame</a></li>
 
74
<li><div class="fn"/>183 public functions inherited from <a href="qwidget.html#public-functions">QWidget</a></li>
 
75
<li><div class="fn"/>28 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
 
76
<li><div class="fn"/>10 public functions inherited from <a href="qpaintdevice.html#public-functions">QPaintDevice</a></li>
 
77
</ul>
 
78
<a name="signals"></a>
 
79
<h3>Signals</h3>
 
80
<ul>
 
81
<li><div class="fn"/>void <b><a href="qsplitter.html#splitterMoved">splitterMoved</a></b> ( int <i>pos</i>, int <i>index</i> )</li>
 
82
</ul>
 
83
<ul>
 
84
<li><div class="fn"/>1 signal inherited from <a href="qwidget.html#signals">QWidget</a></li>
 
85
<li><div class="fn"/>1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
 
86
</ul>
 
87
<a name="protected-functions"></a>
 
88
<h3>Protected Functions</h3>
 
89
<ul>
 
90
<li><div class="fn"/>int <b><a href="qsplitter.html#closestLegalPosition">closestLegalPosition</a></b> ( int <i>pos</i>, int <i>index</i> )</li>
 
91
<li><div class="fn"/>virtual QSplitterHandle * <b><a href="qsplitter.html#createHandle">createHandle</a></b> ()</li>
 
92
<li><div class="fn"/>void <b><a href="qsplitter.html#moveSplitter">moveSplitter</a></b> ( int <i>pos</i>, int <i>index</i> )</li>
 
93
<li><div class="fn"/>void <b><a href="qsplitter.html#setRubberBand">setRubberBand</a></b> ( int <i>pos</i> )</li>
 
94
</ul>
 
95
<ul>
 
96
<li><div class="fn"/>39 protected functions inherited from <a href="qwidget.html#protected-functions">QWidget</a></li>
 
97
<li><div class="fn"/>7 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
 
98
</ul>
 
99
<h3>Additional Inherited Members</h3>
 
100
<ul>
 
101
<li><div class="fn"/>17 public slots inherited from <a href="qwidget.html#public-slots">QWidget</a></li>
 
102
<li><div class="fn"/>1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
 
103
<li><div class="fn"/>2 static public members inherited from <a href="qframe.html#static-public-members">QFrame</a></li>
 
104
<li><div class="fn"/>4 static public members inherited from <a href="qwidget.html#static-public-members">QWidget</a></li>
 
105
<li><div class="fn"/>4 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
 
106
</ul>
 
107
<a name="details"></a>
 
108
<hr />
 
109
<h2>Detailed Description</h2>
 
110
<p>The QSplitter class implements a splitter widget.</p>
 
111
<p>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. The typical use of a QSplitter is to create several widgets and add them using <a href="qsplitter.html#insertWidget">insertWidget</a>() or <a href="qsplitter.html#addWidget">addWidget</a>().</p>
 
112
<p>The following example will show a <a href="qlistview.html">QListView</a>, <a href="qtreeview.html">QTreeView</a>, and <a href="qtextedit.html">QTextEdit</a> side by side, with two splitter handles:</p>
 
113
<pre>&nbsp;       QSplitter *splitter = new QSplitter(parent);
 
114
        QListView *listview = new QListView;
 
115
        QTreeView *treeview = new QTreeView;
 
116
        QTextEdit *textedit = new QTextEdit;
 
117
        splitter-&gt;addWidget(listview);
 
118
        splitter-&gt;addWidget(treeview);
 
119
        splitter-&gt;addWidget(textedit);</pre>
 
120
<p>If a widget is already inside a QSplitter when <a href="qsplitter.html#insertWidget">insertWidget</a>() or <a href="qsplitter.html#addWidget">addWidget</a>() is called, it will move to the new position. This can be used to reorder widgets in the splitter later. You can use <a href="qsplitter.html#indexOf">indexOf</a>(), <a href="qsplitter.html#widget">widget</a>(), and <a href="qsplitter.html#count">count</a>() to get access to the widgets inside the splitter.</p>
 
121
<p>A default QSplitter lays out its children horizontally (side by side); you can use setOrientation(<a href="qt.html#Orientation-enum">Qt::Vertical</a>) to lay its children out vertically.</p>
 
122
<p>By default, all widgets can be as large or as small as the user wishes, between the <a href="qsplitter.html#minimumSizeHint">minimumSizeHint</a>() (or <a href="qwidget.html#minimumSize-prop">minimumSize</a>()) and <a href="qwidget.html#maximumSize-prop">maximumSize</a>() of the widgets.</p>
 
123
<p>QSplitter resizes its children dynamically by default. If you would rather have QSplitter resize the children only at the end of a resize operation, call setOpaqueResize(false).</p>
 
124
<p>The initial distribution of size between the widgets is determined by the initial size of each widget. You can also use <a href="qsplitter.html#setSizes">setSizes</a>() to set the sizes of all the widgets. The function <a href="qsplitter.html#sizes">sizes</a>() returns the sizes set by the user. Alternatively, you can save and restore the sizes of the widgets from a <a href="qbytearray.html">QByteArray</a> using <a href="qsplitter.html#saveState">saveState</a>() and <a href="qsplitter.html#restoreState">restoreState</a>() respectively.</p>
 
125
<p>When you <a href="qwidget.html#hide">hide</a>() a child its space will be distributed among the other children. It will be reinstated when you <a href="qwidget.html#show">show</a>() it again.</p>
 
126
<p><img src="images/qsplitter-m.png" alt="Screenshot in Motif style" /> <img src="images/qsplitter-w.png" alt="Screenshot in Windows style" /></p>
 
127
<p>See also <a href="qsplitterhandle.html">QSplitterHandle</a>, <a href="qhboxlayout.html">QHBoxLayout</a>, <a href="qvboxlayout.html">QVBoxLayout</a>, and <a href="qtabwidget.html">QTabWidget</a>.</p>
 
128
<hr />
 
129
<h2>Property Documentation</h2>
 
130
<h3 class="fn"><a name="childrenCollapsible-prop"></a>childrenCollapsible : bool</h3>
 
131
<p>This property holds whether child widgets can be resized down to size 0 by the user.</p>
 
132
<p>By default, children are collapsible. It is possible to enable and disable the collapsing of individual children using <a href="qsplitter.html#setCollapsible">setCollapsible</a>().</p>
 
133
<p>Access functions:</p>
 
134
<ul>
 
135
<li><div class="fn"/><b>bool childrenCollapsible () const</b></li>
 
136
<li><div class="fn"/><b>void setChildrenCollapsible ( bool )</b></li>
 
137
</ul>
 
138
<p>See also <a href="qsplitter.html#setCollapsible">setCollapsible</a>().</p>
 
139
<h3 class="fn"><a name="handleWidth-prop"></a>handleWidth : int</h3>
 
140
<p>This property holds the width of the splitter handles.</p>
 
141
<p>Access functions:</p>
 
142
<ul>
 
143
<li><div class="fn"/><b>int handleWidth () const</b></li>
 
144
<li><div class="fn"/><b>void setHandleWidth ( int )</b></li>
 
145
</ul>
 
146
<h3 class="fn"><a name="opaqueResize-prop"></a>opaqueResize : bool</h3>
 
147
<p>This property holds whether resizing is opaque.</p>
 
148
<p>Opaque resizing is on by default.</p>
 
149
<p>Access functions:</p>
 
150
<ul>
 
151
<li><div class="fn"/><b>bool opaqueResize () const</b></li>
 
152
<li><div class="fn"/><b>void setOpaqueResize ( bool <i>opaque</i> = true )</b></li>
 
153
</ul>
 
154
<h3 class="fn"><a name="orientation-prop"></a>orientation : <a href="qt.html#Orientation-enum">Qt::Orientation</a></h3>
 
155
<p>This property holds the orientation of the splitter.</p>
 
156
<p>By default the orientation is horizontal (i.e., the widgets are laid out side by side). The possible orientations are <a href="qt.html#Orientation-enum">Qt::Horizontal</a> and <a href="qt.html#Orientation-enum">Qt::Vertical</a>.</p>
 
157
<p>Access functions:</p>
 
158
<ul>
 
159
<li><div class="fn"/><b>Qt::Orientation orientation () const</b></li>
 
160
<li><div class="fn"/><b>void setOrientation ( Qt::Orientation )</b></li>
 
161
</ul>
 
162
<p>See also <a href="qsplitterhandle.html#orientation">QSplitterHandle::orientation</a>().</p>
 
163
<hr />
 
164
<h2>Member Function Documentation</h2>
 
165
<h3 class="fn"><a name="QSplitter"></a>QSplitter::QSplitter ( <a href="qwidget.html">QWidget</a> * <i>parent</i> = 0 )</h3>
 
166
<p>Constructs a horizontal splitter with the <i>parent</i> arguments is passed on to the <a href="qframe.html">QFrame</a> constructor.</p>
 
167
<p>See also <a href="qsplitter.html#orientation-prop">setOrientation</a>().</p>
 
168
<h3 class="fn"><a name="QSplitter-2"></a>QSplitter::QSplitter ( <a href="qt.html#Orientation-enum">Qt::Orientation</a> <i>orientation</i>, <a href="qwidget.html">QWidget</a> * <i>parent</i> = 0 )</h3>
 
169
<p>Constructs a splitter with the given <i>orientation</i> and <i>parent</i>.</p>
 
170
<p>See also <a href="qsplitter.html#orientation-prop">setOrientation</a>().</p>
 
171
<h3 class="fn"><a name="dtor.QSplitter"></a>QSplitter::~QSplitter ()</h3>
 
172
<p>Destroys the splitter. All children are deleted.</p>
 
173
<h3 class="fn"><a name="addWidget"></a>void QSplitter::addWidget ( <a href="qwidget.html">QWidget</a> * <i>widget</i> )</h3>
 
174
<p>Adds the given <i>widget</i> to the splitter's layout after all the other items.</p>
 
175
<p>If <i>widget</i> is already in the splitter, it will be moved to the new position.</p>
 
176
<p>See also <a href="qsplitter.html#insertWidget">insertWidget</a>(), <a href="qsplitter.html#widget">widget</a>(), and <a href="qsplitter.html#indexOf">indexOf</a>().</p>
 
177
<h3 class="fn"><a name="closestLegalPosition"></a>int QSplitter::closestLegalPosition ( int <i>pos</i>, int <i>index</i> )&nbsp;&nbsp;<tt> [protected]</tt></h3>
 
178
<p>Returns the closest legal position to <i>pos</i> of the widget with index <i>index</i>.</p>
 
179
<p>For right-to-left languages such as Arabic and Hebrew, the layout of horizontal splitters is reversed. Positions are then measured from the right edge of the widget.</p>
 
180
<p>See also <a href="qsplitter.html#getRange">getRange</a>().</p>
 
181
<h3 class="fn"><a name="count"></a>int QSplitter::count () const</h3>
 
182
<p>Returns the number of widgets contained in the splitter's layout.</p>
 
183
<p>See also <a href="qsplitter.html#widget">widget</a>() and <a href="qsplitter.html#handle">handle</a>().</p>
 
184
<h3 class="fn"><a name="createHandle"></a><a href="qsplitterhandle.html">QSplitterHandle</a> * QSplitter::createHandle ()&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
 
185
<p>Returns a new splitter handle as a child widget of this splitter. This function can be reimplemented in subclasses to provide support for custom handles.</p>
 
186
<p>See also <a href="qsplitter.html#handle">handle</a>() and <a href="qsplitter.html#indexOf">indexOf</a>().</p>
 
187
<h3 class="fn"><a name="getRange"></a>void QSplitter::getRange ( int <i>index</i>, int * <i>min</i>, int * <i>max</i> ) const</h3>
 
188
<p>Returns the valid range of the splitter with index <i>index</i> in <tt>*</tt><i>min</i> and <tt>*</tt><i>max</i> if <i>min</i> and <i>max</i> are not 0.</p>
 
189
<h3 class="fn"><a name="handle"></a><a href="qsplitterhandle.html">QSplitterHandle</a> * QSplitter::handle ( int <i>index</i> ) const</h3>
 
190
<p>Returns the handle to the left (or above) for the item in the splitter's layout at the given <i>index</i>. The handle at index 0 is always hidden.</p>
 
191
<p>For right-to-left languages such as Arabic and Hebrew, the layout of horizontal splitters is reversed. The handle will be to the right of the widget at <i>index</i>.</p>
 
192
<p>See also <a href="qsplitter.html#count">count</a>(), <a href="qsplitter.html#widget">widget</a>(), <a href="qsplitter.html#indexOf">indexOf</a>(), <a href="qsplitter.html#createHandle">createHandle</a>(), and <a href="qsplitter.html#handleWidth-prop">setHandleWidth</a>().</p>
 
193
<h3 class="fn"><a name="indexOf"></a>int QSplitter::indexOf ( <a href="qwidget.html">QWidget</a> * <i>widget</i> ) const</h3>
 
194
<p>Returns the index in the splitter's layout of the specified <i>widget</i>. This also works for handles.</p>
 
195
<p>Handles are numbered from 0. There are as many handles as there are child widgets, but the handle at position 0 is always hidden.</p>
 
196
<p>See also <a href="qsplitter.html#count">count</a>() and <a href="qsplitter.html#widget">widget</a>().</p>
 
197
<h3 class="fn"><a name="insertWidget"></a>void QSplitter::insertWidget ( int <i>index</i>, <a href="qwidget.html">QWidget</a> * <i>widget</i> )</h3>
 
198
<p>Inserts the <i>widget</i> specified into the splitter's layout at the given <i>index</i>.</p>
 
199
<p>If <i>widget</i> is already in the splitter, it will be moved to the new position.</p>
 
200
<p>if <i>index</i> is an invalid index, then the widget will be inserted at the end.</p>
 
201
<p>See also <a href="qsplitter.html#addWidget">addWidget</a>(), <a href="qsplitter.html#indexOf">indexOf</a>(), and <a href="qsplitter.html#widget">widget</a>().</p>
 
202
<h3 class="fn"><a name="isCollapsible"></a>bool QSplitter::isCollapsible ( int <i>index</i> ) const</h3>
 
203
<p>Returns true if the widget at <i>index</i> is collapsible, otherwise returns false</p>
 
204
<h3 class="fn"><a name="moveSplitter"></a>void QSplitter::moveSplitter ( int <i>pos</i>, int <i>index</i> )&nbsp;&nbsp;<tt> [protected]</tt></h3>
 
205
<p>Moves the left or top edge of the splitter handle at <i>index</i> as close as possible to position <i>pos</i>, which is the distance from the left or top edge of the widget.</p>
 
206
<p>For right-to-left languages such as Arabic and Hebrew, the layout of horizontal splitters is reversed. <i>pos</i> is then the distance from the right edge of the widget.</p>
 
207
<p>See also <a href="qsplitter.html#splitterMoved">splitterMoved</a>(), <a href="qsplitter.html#closestLegalPosition">closestLegalPosition</a>(), and <a href="qsplitter.html#getRange">getRange</a>().</p>
 
208
<h3 class="fn"><a name="refresh"></a>void QSplitter::refresh ()</h3>
 
209
<p>Updates the splitter's state. You should not need to call this function.</p>
 
210
<h3 class="fn"><a name="restoreState"></a>bool QSplitter::restoreState ( const <a href="qbytearray.html">QByteArray</a> &amp; <i>state</i> )</h3>
 
211
<p>Restores the splitter's layout to the <i>state</i> specified.</p>
 
212
<p>Typically this is used in conjunction with <a href="qsettings.html">QSettings</a> to restore the size from a past session. Here is an example:</p>
 
213
<p>Restore the splitters's state:</p>
 
214
<pre>&nbsp;       QSettings settings;
 
215
        splitter-&gt;restoreState(settings.value(&quot;splitterSizes&quot;).toByteArray());</pre>
 
216
<p>See also <a href="qsplitter.html#saveState">saveState</a>().</p>
 
217
<h3 class="fn"><a name="saveState"></a><a href="qbytearray.html">QByteArray</a> QSplitter::saveState () const</h3>
 
218
<p>Saves the state of the splitter's layout.</p>
 
219
<p>Typically this is used in conjunction with <a href="qsettings.html">QSettings</a> to remember the size for a future session. A version number is stored as part of the data. Here is an example:</p>
 
220
<pre>&nbsp;       QSettings settings;
 
221
        settings.setValue(&quot;splitterSizes&quot;, splitter-&gt;saveState());</pre>
 
222
<p>See also <a href="qsplitter.html#restoreState">restoreState</a>().</p>
 
223
<h3 class="fn"><a name="setCollapsible"></a>void QSplitter::setCollapsible ( int <i>index</i>, bool <i>collapse</i> )</h3>
 
224
<p>Sets whether the child widget at index <i>index</i> is collapsible to <i>collapse</i>.</p>
 
225
<p>By default, children are collapsible, meaning that the user can resize them down to size 0, even if they have a non-zero <a href="qwidget.html#minimumSize-prop">minimumSize</a>() or <a href="qsplitter.html#minimumSizeHint">minimumSizeHint</a>(). 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 <a href="qsplitter.html#childrenCollapsible-prop">childrenCollapsible</a> property.</p>
 
226
<p>See also <a href="qsplitter.html#childrenCollapsible-prop">childrenCollapsible</a>.</p>
 
227
<h3 class="fn"><a name="setRubberBand"></a>void QSplitter::setRubberBand ( int <i>pos</i> )&nbsp;&nbsp;<tt> [protected]</tt></h3>
 
228
<p>Displays a rubber band at position <i>pos</i>. If <i>pos</i> is negative, the rubber band is removed.</p>
 
229
<h3 class="fn"><a name="setSizes"></a>void QSplitter::setSizes ( const <a href="qlist.html">QList</a>&lt;int&gt; &amp; <i>list</i> )</h3>
 
230
<p>Sets the size parameters to the values given in the <i>list</i>. 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 <i>list</i> are ignored.</p>
 
231
<p>If <i>list</i> contains too few values, the result is undefined but the program will still be well-behaved.</p>
 
232
<p>The values in <i>list</i> should be the height or width (depending on <a href="qsplitter.html#orientation-prop">orientation</a>()) that the widgets should be resized to.</p>
 
233
<p>See also <a href="qsplitter.html#sizes">sizes</a>().</p>
 
234
<h3 class="fn"><a name="setStretchFactor"></a>void QSplitter::setStretchFactor ( int <i>index</i>, int <i>stretch</i> )</h3>
 
235
<p>Updates the size policy of the widget at position <i>index</i> to have a stretch factor of <i>stretch</i>.</p>
 
236
<p>This function is provided for convenience. It is equivalent to</p>
 
237
<pre>&nbsp;   QWidget *widget = splitter-&gt;widget(index);
 
238
    QSizePolicy policy = widget-&gt;sizePolicy();
 
239
    policy.setHorizontalStretch(stretch);
 
240
    policy.setVerticalStretch(stretch);
 
241
    widget-&gt;setSizePolicy(policy);</pre>
 
242
<p>See also <a href="qsplitter.html#setSizes">setSizes</a>() and <a href="qsplitter.html#widget">widget</a>().</p>
 
243
<h3 class="fn"><a name="sizes"></a><a href="qlist.html">QList</a>&lt;int&gt; QSplitter::sizes () const</h3>
 
244
<p>Returns a list of the size parameters of all the widgets in this splitter.</p>
 
245
<p>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.</p>
 
246
<p>Giving the values to another splitter's <a href="qsplitter.html#setSizes">setSizes</a>() function will produce a splitter with the same layout as this one.</p>
 
247
<p>The easiest way to iterate over the list is to use the Java-style iterators.</p>
 
248
<pre>&nbsp;       QListIterator&lt;int&gt; it(splitter-&gt;sizes());
 
249
        while (it.hasNext())
 
250
            processSize(it.next());</pre>
 
251
<p>See also <a href="qsplitter.html#setSizes">setSizes</a>().</p>
 
252
<h3 class="fn"><a name="splitterMoved"></a>void QSplitter::splitterMoved ( int <i>pos</i>, int <i>index</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
 
253
<p>This signal is emitted when the splitter handle at a particular <i>index</i> has been moved to position <i>pos</i>.</p>
 
254
<p>For right-to-left languages such as Arabic and Hebrew, the layout of horizontal splitters is reversed. <i>pos</i> is then the distance from the right edge of the widget.</p>
 
255
<p>See also <a href="qsplitter.html#moveSplitter">moveSplitter</a>().</p>
 
256
<h3 class="fn"><a name="widget"></a><a href="qwidget.html">QWidget</a> * QSplitter::widget ( int <i>index</i> ) const</h3>
 
257
<p>Returns the widget at the given <i>index</i> in the splitter's layout.</p>
 
258
<p>See also <a href="qsplitter.html#count">count</a>(), <a href="qsplitter.html#handle">handle</a>(), <a href="qsplitter.html#indexOf">indexOf</a>(), and <a href="qsplitter.html#insertWidget">insertWidget</a>().</p>
 
259
<p /><address><hr /><div align="center">
 
260
<table width="100%" cellspacing="0" border="0"><tr class="address">
 
261
<td width="30%">Copyright &copy; 2005 <a href="trolltech.html">Trolltech</a></td>
 
262
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
 
263
<td width="30%" align="right"><div align="right">Qt 4.0.0</div></td>
 
264
</tr></table></div></address></body>
 
265
</html>