source: trunk/doc/html/qdockarea.html

Last change on this file was 190, checked in by rudi, 14 years ago

reference documentation added

File size: 16.5 KB
Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/widgets/qdockarea.cpp:450 -->
3<html>
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
6<title>QDockArea Class</title>
7<style type="text/css"><!--
8fn { margin-left: 1cm; text-indent: -1cm; }
9a:link { color: #004faf; text-decoration: none }
10a:visited { color: #672967; text-decoration: none }
11body { background: #ffffff; color: black; }
12--></style>
13</head>
14<body>
15
16<table border="0" cellpadding="0" cellspacing="0" width="100%">
17<tr bgcolor="#E5E5E5">
18<td valign=center>
19 <a href="index.html">
20<font color="#004faf">Home</font></a>
21 | <a href="classes.html">
22<font color="#004faf">All&nbsp;Classes</font></a>
23 | <a href="mainclasses.html">
24<font color="#004faf">Main&nbsp;Classes</font></a>
25 | <a href="annotated.html">
26<font color="#004faf">Annotated</font></a>
27 | <a href="groups.html">
28<font color="#004faf">Grouped&nbsp;Classes</font></a>
29 | <a href="functions.html">
30<font color="#004faf">Functions</font></a>
31</td>
32<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QDockArea Class Reference</h1>
33
34<p>The QDockArea class manages and lays out QDockWindows.
35<a href="#details">More...</a>
36<p><tt>#include &lt;<a href="qdockarea-h.html">qdockarea.h</a>&gt;</tt>
37<p>Inherits <a href="qwidget.html">QWidget</a>.
38<p><a href="qdockarea-members.html">List of all member functions.</a>
39<h2>Public Members</h2>
40<ul>
41<li class=fn>enum <a href="#HandlePosition-enum"><b>HandlePosition</b></a> { Normal, Reverse }</li>
42<li class=fn><a href="#QDockArea"><b>QDockArea</b></a> ( Orientation&nbsp;o, HandlePosition&nbsp;h = Normal, QWidget&nbsp;*&nbsp;parent = 0, const&nbsp;char&nbsp;*&nbsp;name = 0 )</li>
43<li class=fn><a href="#~QDockArea"><b>~QDockArea</b></a> ()</li>
44<li class=fn>void <a href="#moveDockWindow-2"><b>moveDockWindow</b></a> ( QDockWindow&nbsp;*&nbsp;w, const&nbsp;QPoint&nbsp;&amp;&nbsp;p, const&nbsp;QRect&nbsp;&amp;&nbsp;r, bool&nbsp;swap )</li>
45<li class=fn>void <a href="#removeDockWindow"><b>removeDockWindow</b></a> ( QDockWindow&nbsp;*&nbsp;w, bool&nbsp;makeFloating, bool&nbsp;swap, bool&nbsp;fixNewLines = TRUE )</li>
46<li class=fn>void <a href="#moveDockWindow"><b>moveDockWindow</b></a> ( QDockWindow&nbsp;*&nbsp;w, int&nbsp;index = -1 )</li>
47<li class=fn>bool <a href="#hasDockWindow"><b>hasDockWindow</b></a> ( QDockWindow&nbsp;*&nbsp;w, int&nbsp;*&nbsp;index = 0 )</li>
48<li class=fn>Orientation <a href="#orientation"><b>orientation</b></a> () const</li>
49<li class=fn>HandlePosition <a href="#handlePosition"><b>handlePosition</b></a> () const</li>
50<li class=fn>bool <a href="#isEmpty"><b>isEmpty</b></a> () const</li>
51<li class=fn>int <a href="#count"><b>count</b></a> () const</li>
52<li class=fn>QPtrList&lt;QDockWindow&gt; <a href="#dockWindowList"><b>dockWindowList</b></a> () const</li>
53<li class=fn>bool <a href="#isDockWindowAccepted"><b>isDockWindowAccepted</b></a> ( QDockWindow&nbsp;*&nbsp;dw )</li>
54<li class=fn>void <a href="#setAcceptDockWindow"><b>setAcceptDockWindow</b></a> ( QDockWindow&nbsp;*&nbsp;dw, bool&nbsp;accept )</li>
55</ul>
56<h2>Public Slots</h2>
57<ul>
58<li class=fn>void <a href="#lineUp"><b>lineUp</b></a> ( bool&nbsp;keepNewLines )</li>
59</ul>
60<h2>Properties</h2>
61<ul>
62<li class=fn>int <a href="#count-prop"><b>count</b></a>&nbsp;- the number of dock windows in the dock area &nbsp;<em>(read only)</em></li>
63<li class=fn>bool <a href="#empty-prop"><b>empty</b></a>&nbsp;- whether the dock area is empty &nbsp;<em>(read only)</em></li>
64<li class=fn>HandlePosition <a href="#handlePosition-prop"><b>handlePosition</b></a>&nbsp;- where the dock window splitter handle is placed in the dock area &nbsp;<em>(read only)</em></li>
65<li class=fn>Orientation <a href="#orientation-prop"><b>orientation</b></a>&nbsp;- the dock area's orientation &nbsp;<em>(read only)</em></li>
66</ul>
67<h2>Related Functions</h2>
68<ul>
69<li class=fn>QTextStream &amp; <a href="#operator-lt-lt"><b>operator&lt;&lt;</b></a> ( QTextStream&nbsp;&amp;&nbsp;ts, const&nbsp;QDockArea&nbsp;&amp;&nbsp;dockArea )</li>
70<li class=fn>QTextStream &amp; <a href="#operator-gt-gt"><b>operator&gt;&gt;</b></a> ( QTextStream&nbsp;&amp;&nbsp;ts, QDockArea&nbsp;&amp;&nbsp;dockArea )</li>
71</ul>
72<hr><a name="details"></a><h2>Detailed Description</h2>
73
74
75The QDockArea class manages and lays out QDockWindows.
76<p>
77<p> A QDockArea is a container which manages a list of
78<a href="qdockwindow.html">QDockWindow</a>s which it lays out within its area. In cooperation
79with the <a href="qdockwindow.html">QDockWindow</a>s it is responsible for the docking and
80undocking of <a href="qdockwindow.html">QDockWindow</a>s and moving them inside the dock
81area. QDockAreas also handle the wrapping of <a href="qdockwindow.html">QDockWindow</a>s to
82fill the available space as compactly as possible. QDockAreas can
83contain QToolBars since <a href="qtoolbar.html">QToolBar</a> is a <a href="qdockwindow.html">QDockWindow</a> subclass.
84<p> <a href="qmainwindow.html">QMainWindow</a> contains four QDockAreas which you can use for your
85QToolBars and QDockWindows, so in most situations you do not need
86to use the QDockArea class directly. Although QMainWindow contains
87support for its own dock areas it isn't convenient for adding new
88QDockAreas. If you need to create your own dock areas we suggest
89that you create a subclass of <a href="qwidget.html">QWidget</a> and add your QDockAreas to
90your subclass.
91<p> <center><img src="qmainwindow-qdockareas.png" alt="QMainWindow's QDockAreas"></center>
92<p> <a name="lines"></a>
93<em>Lines</em>. QDockArea uses the concept of lines. A line is a
94horizontal region which may contain dock windows side-by-side. A
95dock area may have room for more than one line. When dock windows
96are docked into a dock area they are usually added at the right
97hand side of the top-most line that has room (unless manually
98placed by the user). When users move dock windows they may leave
99empty lines or gaps in non-empty lines. Dock windows can be lined
100up to minimize wasted space using the <a href="#lineUp">lineUp</a>() function.
101<p> The QDockArea class maintains a position list of all its child
102dock windows. Dock windows are added to a dock area from position
1030 onwards. Dock windows are laid out sequentially in position
104order from left to right, and in the case of multiple lines of
105dock windows, from top to bottom. If a dock window is floated it
106still retains its position since this is where the window will
107return if the user double clicks its caption. A dock window's
108position can be determined with <a href="#hasDockWindow">hasDockWindow</a>(). The position can
109be changed with <a href="#moveDockWindow">moveDockWindow</a>().
110<p> To dock or undock a dock window use <a href="qdockwindow.html#dock">QDockWindow::dock</a>() and
111<a href="qdockwindow.html#undock">QDockWindow::undock</a>() respectively. If you want to control which
112dock windows can dock in a dock area use <a href="#setAcceptDockWindow">setAcceptDockWindow</a>(). To
113see if a dock area contains a particular dock window use
114<a href="#hasDockWindow">hasDockWindow</a>(); to see how many dock windows a dock area
115contains use <a href="#count">count</a>().
116<p> The streaming operators can write the positions of the dock
117windows in the dock area to a <a href="qtextstream.html">QTextStream</a>. The positions can be
118read back later to restore the saved positions.
119<p> Save the positions to a QTextStream:
120<pre>
121 ts &lt;&lt; *myDockArea;
122 </pre>
123
124<p> Restore the positions from a QTextStream:
125<pre>
126 ts &gt;&gt; *myDockArea;
127 </pre>
128
129<p>See also <a href="application.html">Main Window and Related Classes</a>.
130
131<hr><h2>Member Type Documentation</h2>
132<h3 class=fn><a name="HandlePosition-enum"></a>QDockArea::HandlePosition</h3>
133
134<p> A dock window has two kinds of handles, the dock window handle
135used for dragging the dock window, and the splitter handle used to
136resize the dock window in relation to other dock windows using a
137splitter. (The splitter handle is only visible for docked
138windows.)
139<p> This enum specifies where the dock window splitter handle is
140placed in the dock area.
141<ul>
142<li><tt>QDockArea::Normal</tt> - The splitter handles of dock windows are placed at
143the right or bottom.
144<li><tt>QDockArea::Reverse</tt> - The splitter handles of dock windows are placed at
145the left or top.
146</ul>
147<hr><h2>Member Function Documentation</h2>
148<h3 class=fn><a name="QDockArea"></a>QDockArea::QDockArea ( <a href="qt.html#Orientation-enum">Orientation</a>&nbsp;o, <a href="qdockarea.html#HandlePosition-enum">HandlePosition</a>&nbsp;h = Normal, <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;parent = 0, const&nbsp;char&nbsp;*&nbsp;name = 0 )
149</h3>
150Constructs a QDockArea with orientation <em>o</em>, HandlePosition <em>h</em>,
151parent <em>parent</em> and called <em>name</em>.
152
153<h3 class=fn><a name="~QDockArea"></a>QDockArea::~QDockArea ()
154</h3>
155Destroys the dock area and all the dock windows docked in the dock
156area.
157<p> Does not affect any floating dock windows or dock windows in other
158dock areas, even if they first appeared in this dock area.
159Floating dock windows are effectively top level windows and are
160not child windows of the dock area. When a floating dock window is
161docked (dragged into a dock area) its parent becomes the dock
162area.
163
164<h3 class=fn>int <a name="count"></a>QDockArea::count () const
165</h3><p>Returns the number of dock windows in the dock area.
166See the <a href="qdockarea.html#count-prop">"count"</a> property for details.
167<h3 class=fn><a href="qptrlist.html">QPtrList</a>&lt;QDockWindow&gt; <a name="dockWindowList"></a>QDockArea::dockWindowList () const
168</h3>
169Returns a list of the dock windows in the dock area.
170
171<h3 class=fn><a href="qdockarea.html#HandlePosition-enum">HandlePosition</a> <a name="handlePosition"></a>QDockArea::handlePosition () const
172</h3><p>Returns where the dock window splitter handle is placed in the dock area.
173See the <a href="qdockarea.html#handlePosition-prop">"handlePosition"</a> property for details.
174<h3 class=fn>bool <a name="hasDockWindow"></a>QDockArea::hasDockWindow ( <a href="qdockwindow.html">QDockWindow</a>&nbsp;*&nbsp;w, int&nbsp;*&nbsp;index = 0 )
175</h3>
176Returns TRUE if the dock area contains the dock window <em>w</em>;
177otherwise returns FALSE. If <em>index</em> is not 0 it will be set as
178follows: if the dock area contains the dock window <em>*index</em> is
179set to <em>w</em>'s index position; otherwise <em>*index</em> is set to -1.
180
181<h3 class=fn>bool <a name="isDockWindowAccepted"></a>QDockArea::isDockWindowAccepted ( <a href="qdockwindow.html">QDockWindow</a>&nbsp;*&nbsp;dw )
182</h3>
183Returns TRUE if dock window <em>dw</em> could be docked into the dock
184area; otherwise returns FALSE.
185<p> <p>See also <a href="#setAcceptDockWindow">setAcceptDockWindow</a>().
186
187<h3 class=fn>bool <a name="isEmpty"></a>QDockArea::isEmpty () const
188</h3><p>Returns TRUE if the dock area is empty; otherwise returns FALSE.
189See the <a href="qdockarea.html#empty-prop">"empty"</a> property for details.
190<h3 class=fn>void <a name="lineUp"></a>QDockArea::lineUp ( bool&nbsp;keepNewLines )<tt> [slot]</tt>
191</h3>
192Lines up the dock windows in this dock area to minimize wasted
193space. If <em>keepNewLines</em> is TRUE, only space within lines is
194cleaned up. If <em>keepNewLines</em> is FALSE the number of lines might
195be changed.
196
197<h3 class=fn>void <a name="moveDockWindow"></a>QDockArea::moveDockWindow ( <a href="qdockwindow.html">QDockWindow</a>&nbsp;*&nbsp;w, int&nbsp;index = -1 )
198</h3>
199Moves the <a href="qdockwindow.html">QDockWindow</a> <em>w</em> within the dock area. If <em>w</em> is not
200already docked in this area, <em>w</em> is docked first. If <em>index</em> is
201-1 or larger than the number of docked widgets, <em>w</em> is appended
202at the end, otherwise it is inserted at the position <em>index</em>.
203
204<h3 class=fn>void <a name="moveDockWindow-2"></a>QDockArea::moveDockWindow ( <a href="qdockwindow.html">QDockWindow</a>&nbsp;*&nbsp;w, const&nbsp;<a href="qpoint.html">QPoint</a>&nbsp;&amp;&nbsp;p, const&nbsp;<a href="qrect.html">QRect</a>&nbsp;&amp;&nbsp;r, bool&nbsp;swap )
205</h3>
206This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
207<p> Moves the dock window <em>w</em> inside the dock area where <em>p</em> is the
208new position (in global screen coordinates), <em>r</em> is the suggested
209rectangle of the dock window and <em>swap</em> specifies whether or not
210the orientation of the docked widget needs to be changed.
211<p> This function is used internally by <a href="qdockwindow.html">QDockWindow</a>. You shouldn't
212need to call it yourself.
213
214<h3 class=fn><a href="qt.html#Orientation-enum">Orientation</a> <a name="orientation"></a>QDockArea::orientation () const
215</h3><p>Returns the dock area's orientation.
216See the <a href="qdockarea.html#orientation-prop">"orientation"</a> property for details.
217<h3 class=fn>void <a name="removeDockWindow"></a>QDockArea::removeDockWindow ( <a href="qdockwindow.html">QDockWindow</a>&nbsp;*&nbsp;w, bool&nbsp;makeFloating, bool&nbsp;swap, bool&nbsp;fixNewLines = TRUE )
218</h3>
219Removes the dock window <em>w</em> from the dock area. If <em>makeFloating</em> is TRUE, <em>w</em> gets floated, and if <em>swap</em> is TRUE,
220the orientation of <em>w</em> gets swapped. If <em>fixNewLines</em> is TRUE
221(the default) newlines in the area will be fixed.
222<p> You should never need to call this function yourself. Use
223<a href="qdockwindow.html#dock">QDockWindow::dock</a>() and <a href="qdockwindow.html#undock">QDockWindow::undock</a>() instead.
224
225<h3 class=fn>void <a name="setAcceptDockWindow"></a>QDockArea::setAcceptDockWindow ( <a href="qdockwindow.html">QDockWindow</a>&nbsp;*&nbsp;dw, bool&nbsp;accept )
226</h3>
227If <em>accept</em> is TRUE, dock window <em>dw</em> can be docked in the dock
228area. If <em>accept</em> is FALSE, dock window <em>dw</em> cannot be docked in
229the dock area.
230<p> <p>See also <a href="#isDockWindowAccepted">isDockWindowAccepted</a>().
231
232<hr><h2>Property Documentation</h2>
233<h3 class=fn>int <a name="count-prop"></a>count</h3>
234<p>This property holds the number of dock windows in the dock area.
235<p>
236<p>Get this property's value with <a href="#count">count</a>().
237<h3 class=fn>bool <a name="empty-prop"></a>empty</h3>
238<p>This property holds whether the dock area is empty.
239<p>
240<p>Get this property's value with <a href="#isEmpty">isEmpty</a>().
241<h3 class=fn><a href="qdockarea.html#HandlePosition-enum">HandlePosition</a> <a name="handlePosition-prop"></a>handlePosition</h3>
242<p>This property holds where the dock window splitter handle is placed in the dock area.
243<p>The default position is <a href="#HandlePosition-enum">Normal</a>.
244
245<p>Get this property's value with <a href="#handlePosition">handlePosition</a>().
246<h3 class=fn><a href="qt.html#Orientation-enum">Orientation</a> <a name="orientation-prop"></a>orientation</h3>
247<p>This property holds the dock area's orientation.
248<p>There is no default value; the orientation is specified in the
249constructor.
250
251<p>Get this property's value with <a href="#orientation">orientation</a>().
252<hr><h2>Related Functions</h2>
253<h3 class=fn><a href="qtextstream.html">QTextStream</a>&nbsp;&amp; <a name="operator-lt-lt"></a>operator&lt;&lt; ( <a href="qtextstream.html">QTextStream</a>&nbsp;&amp;&nbsp;ts, const&nbsp;<a href="qdockarea.html">QDockArea</a>&nbsp;&amp;&nbsp;dockArea )
254</h3>
255
256<p> Writes the layout of the dock windows in dock area <em>dockArea</em> to
257the text stream <em>ts</em>.
258<p> <p>See also <a href="#operator-gt-gt">operator&gt;&gt;</a>().
259
260<h3 class=fn><a href="qtextstream.html">QTextStream</a>&nbsp;&amp; <a name="operator-gt-gt"></a>operator&gt;&gt; ( <a href="qtextstream.html">QTextStream</a>&nbsp;&amp;&nbsp;ts, <a href="qdockarea.html">QDockArea</a>&nbsp;&amp;&nbsp;dockArea )
261</h3>
262
263<p> Reads the layout description of the dock windows in dock area <em>dockArea</em> from the text stream <em>ts</em> and restores it. The layout
264description must have been previously written by the <a href="#operator-lt-lt">operator&lt;&lt;</a>()
265function.
266<p> <p>See also <a href="#operator-lt-lt">operator&lt;&lt;</a>().
267
268<!-- eof -->
269<hr><p>
270This file is part of the <a href="index.html">Qt toolkit</a>.
271Copyright &copy; 1995-2007
272<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
273<table width=100% cellspacing=0 border=0><tr>
274<td>Copyright &copy; 2007
275<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
276<td align=right><div align=right>Qt 3.3.8</div>
277</table></div></address></body>
278</html>
Note: See TracBrowser for help on using the repository browser.