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"><!--
|
---|
8 | fn { margin-left: 1cm; text-indent: -1cm; }
|
---|
9 | a:link { color: #004faf; text-decoration: none }
|
---|
10 | a:visited { color: #672967; text-decoration: none }
|
---|
11 | body { 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 Classes</font></a>
|
---|
23 | | <a href="mainclasses.html">
|
---|
24 | <font color="#004faf">Main 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 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 <<a href="qdockarea-h.html">qdockarea.h</a>></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 o, HandlePosition h = Normal, QWidget * parent = 0, const char * 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 * w, const QPoint & p, const QRect & r, bool swap )</li>
|
---|
45 | <li class=fn>void <a href="#removeDockWindow"><b>removeDockWindow</b></a> ( QDockWindow * w, bool makeFloating, bool swap, bool fixNewLines = TRUE )</li>
|
---|
46 | <li class=fn>void <a href="#moveDockWindow"><b>moveDockWindow</b></a> ( QDockWindow * w, int index = -1 )</li>
|
---|
47 | <li class=fn>bool <a href="#hasDockWindow"><b>hasDockWindow</b></a> ( QDockWindow * w, int * 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<QDockWindow> <a href="#dockWindowList"><b>dockWindowList</b></a> () const</li>
|
---|
53 | <li class=fn>bool <a href="#isDockWindowAccepted"><b>isDockWindowAccepted</b></a> ( QDockWindow * dw )</li>
|
---|
54 | <li class=fn>void <a href="#setAcceptDockWindow"><b>setAcceptDockWindow</b></a> ( QDockWindow * dw, bool accept )</li>
|
---|
55 | </ul>
|
---|
56 | <h2>Public Slots</h2>
|
---|
57 | <ul>
|
---|
58 | <li class=fn>void <a href="#lineUp"><b>lineUp</b></a> ( bool keepNewLines )</li>
|
---|
59 | </ul>
|
---|
60 | <h2>Properties</h2>
|
---|
61 | <ul>
|
---|
62 | <li class=fn>int <a href="#count-prop"><b>count</b></a> - the number of dock windows in the dock area <em>(read only)</em></li>
|
---|
63 | <li class=fn>bool <a href="#empty-prop"><b>empty</b></a> - whether the dock area is empty <em>(read only)</em></li>
|
---|
64 | <li class=fn>HandlePosition <a href="#handlePosition-prop"><b>handlePosition</b></a> - where the dock window splitter handle is placed in the dock area <em>(read only)</em></li>
|
---|
65 | <li class=fn>Orientation <a href="#orientation-prop"><b>orientation</b></a> - the dock area's orientation <em>(read only)</em></li>
|
---|
66 | </ul>
|
---|
67 | <h2>Related Functions</h2>
|
---|
68 | <ul>
|
---|
69 | <li class=fn>QTextStream & <a href="#operator-lt-lt"><b>operator<<</b></a> ( QTextStream & ts, const QDockArea & dockArea )</li>
|
---|
70 | <li class=fn>QTextStream & <a href="#operator-gt-gt"><b>operator>></b></a> ( QTextStream & ts, QDockArea & dockArea )</li>
|
---|
71 | </ul>
|
---|
72 | <hr><a name="details"></a><h2>Detailed Description</h2>
|
---|
73 |
|
---|
74 |
|
---|
75 | The 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
|
---|
79 | with the <a href="qdockwindow.html">QDockWindow</a>s it is responsible for the docking and
|
---|
80 | undocking of <a href="qdockwindow.html">QDockWindow</a>s and moving them inside the dock
|
---|
81 | area. QDockAreas also handle the wrapping of <a href="qdockwindow.html">QDockWindow</a>s to
|
---|
82 | fill the available space as compactly as possible. QDockAreas can
|
---|
83 | contain 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
|
---|
85 | QToolBars and QDockWindows, so in most situations you do not need
|
---|
86 | to use the QDockArea class directly. Although QMainWindow contains
|
---|
87 | support for its own dock areas it isn't convenient for adding new
|
---|
88 | QDockAreas. If you need to create your own dock areas we suggest
|
---|
89 | that you create a subclass of <a href="qwidget.html">QWidget</a> and add your QDockAreas to
|
---|
90 | your 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
|
---|
94 | horizontal region which may contain dock windows side-by-side. A
|
---|
95 | dock area may have room for more than one line. When dock windows
|
---|
96 | are docked into a dock area they are usually added at the right
|
---|
97 | hand side of the top-most line that has room (unless manually
|
---|
98 | placed by the user). When users move dock windows they may leave
|
---|
99 | empty lines or gaps in non-empty lines. Dock windows can be lined
|
---|
100 | up 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
|
---|
102 | dock windows. Dock windows are added to a dock area from position
|
---|
103 | 0 onwards. Dock windows are laid out sequentially in position
|
---|
104 | order from left to right, and in the case of multiple lines of
|
---|
105 | dock windows, from top to bottom. If a dock window is floated it
|
---|
106 | still retains its position since this is where the window will
|
---|
107 | return if the user double clicks its caption. A dock window's
|
---|
108 | position can be determined with <a href="#hasDockWindow">hasDockWindow</a>(). The position can
|
---|
109 | be 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
|
---|
112 | dock windows can dock in a dock area use <a href="#setAcceptDockWindow">setAcceptDockWindow</a>(). To
|
---|
113 | see 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
|
---|
115 | contains use <a href="#count">count</a>().
|
---|
116 | <p> The streaming operators can write the positions of the dock
|
---|
117 | windows in the dock area to a <a href="qtextstream.html">QTextStream</a>. The positions can be
|
---|
118 | read back later to restore the saved positions.
|
---|
119 | <p> Save the positions to a QTextStream:
|
---|
120 | <pre>
|
---|
121 | ts << *myDockArea;
|
---|
122 | </pre>
|
---|
123 |
|
---|
124 | <p> Restore the positions from a QTextStream:
|
---|
125 | <pre>
|
---|
126 | ts >> *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
|
---|
135 | used for dragging the dock window, and the splitter handle used to
|
---|
136 | resize the dock window in relation to other dock windows using a
|
---|
137 | splitter. (The splitter handle is only visible for docked
|
---|
138 | windows.)
|
---|
139 | <p> This enum specifies where the dock window splitter handle is
|
---|
140 | placed in the dock area.
|
---|
141 | <ul>
|
---|
142 | <li><tt>QDockArea::Normal</tt> - The splitter handles of dock windows are placed at
|
---|
143 | the right or bottom.
|
---|
144 | <li><tt>QDockArea::Reverse</tt> - The splitter handles of dock windows are placed at
|
---|
145 | the 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> o, <a href="qdockarea.html#HandlePosition-enum">HandlePosition</a> h = Normal, <a href="qwidget.html">QWidget</a> * parent = 0, const char * name = 0 )
|
---|
149 | </h3>
|
---|
150 | Constructs a QDockArea with orientation <em>o</em>, HandlePosition <em>h</em>,
|
---|
151 | parent <em>parent</em> and called <em>name</em>.
|
---|
152 |
|
---|
153 | <h3 class=fn><a name="~QDockArea"></a>QDockArea::~QDockArea ()
|
---|
154 | </h3>
|
---|
155 | Destroys the dock area and all the dock windows docked in the dock
|
---|
156 | area.
|
---|
157 | <p> Does not affect any floating dock windows or dock windows in other
|
---|
158 | dock areas, even if they first appeared in this dock area.
|
---|
159 | Floating dock windows are effectively top level windows and are
|
---|
160 | not child windows of the dock area. When a floating dock window is
|
---|
161 | docked (dragged into a dock area) its parent becomes the dock
|
---|
162 | area.
|
---|
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.
|
---|
166 | See the <a href="qdockarea.html#count-prop">"count"</a> property for details.
|
---|
167 | <h3 class=fn><a href="qptrlist.html">QPtrList</a><QDockWindow> <a name="dockWindowList"></a>QDockArea::dockWindowList () const
|
---|
168 | </h3>
|
---|
169 | Returns 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.
|
---|
173 | See 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> * w, int * index = 0 )
|
---|
175 | </h3>
|
---|
176 | Returns TRUE if the dock area contains the dock window <em>w</em>;
|
---|
177 | otherwise returns FALSE. If <em>index</em> is not 0 it will be set as
|
---|
178 | follows: if the dock area contains the dock window <em>*index</em> is
|
---|
179 | set 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> * dw )
|
---|
182 | </h3>
|
---|
183 | Returns TRUE if dock window <em>dw</em> could be docked into the dock
|
---|
184 | area; 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.
|
---|
189 | See the <a href="qdockarea.html#empty-prop">"empty"</a> property for details.
|
---|
190 | <h3 class=fn>void <a name="lineUp"></a>QDockArea::lineUp ( bool keepNewLines )<tt> [slot]</tt>
|
---|
191 | </h3>
|
---|
192 | Lines up the dock windows in this dock area to minimize wasted
|
---|
193 | space. If <em>keepNewLines</em> is TRUE, only space within lines is
|
---|
194 | cleaned up. If <em>keepNewLines</em> is FALSE the number of lines might
|
---|
195 | be changed.
|
---|
196 |
|
---|
197 | <h3 class=fn>void <a name="moveDockWindow"></a>QDockArea::moveDockWindow ( <a href="qdockwindow.html">QDockWindow</a> * w, int index = -1 )
|
---|
198 | </h3>
|
---|
199 | Moves the <a href="qdockwindow.html">QDockWindow</a> <em>w</em> within the dock area. If <em>w</em> is not
|
---|
200 | already 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
|
---|
202 | at 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> * w, const <a href="qpoint.html">QPoint</a> & p, const <a href="qrect.html">QRect</a> & r, bool swap )
|
---|
205 | </h3>
|
---|
206 | This 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
|
---|
208 | new position (in global screen coordinates), <em>r</em> is the suggested
|
---|
209 | rectangle of the dock window and <em>swap</em> specifies whether or not
|
---|
210 | the 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
|
---|
212 | need 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.
|
---|
216 | See 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> * w, bool makeFloating, bool swap, bool fixNewLines = TRUE )
|
---|
218 | </h3>
|
---|
219 | Removes 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,
|
---|
220 | the 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> * dw, bool accept )
|
---|
226 | </h3>
|
---|
227 | If <em>accept</em> is TRUE, dock window <em>dw</em> can be docked in the dock
|
---|
228 | area. If <em>accept</em> is FALSE, dock window <em>dw</em> cannot be docked in
|
---|
229 | the 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
|
---|
249 | constructor.
|
---|
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> & <a name="operator-lt-lt"></a>operator<< ( <a href="qtextstream.html">QTextStream</a> & ts, const <a href="qdockarea.html">QDockArea</a> & dockArea )
|
---|
254 | </h3>
|
---|
255 |
|
---|
256 | <p> Writes the layout of the dock windows in dock area <em>dockArea</em> to
|
---|
257 | the text stream <em>ts</em>.
|
---|
258 | <p> <p>See also <a href="#operator-gt-gt">operator>></a>().
|
---|
259 |
|
---|
260 | <h3 class=fn><a href="qtextstream.html">QTextStream</a> & <a name="operator-gt-gt"></a>operator>> ( <a href="qtextstream.html">QTextStream</a> & ts, <a href="qdockarea.html">QDockArea</a> & 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
|
---|
264 | description must have been previously written by the <a href="#operator-lt-lt">operator<<</a>()
|
---|
265 | function.
|
---|
266 | <p> <p>See also <a href="#operator-lt-lt">operator<<</a>().
|
---|
267 |
|
---|
268 | <!-- eof -->
|
---|
269 | <hr><p>
|
---|
270 | This file is part of the <a href="index.html">Qt toolkit</a>.
|
---|
271 | Copyright © 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 © 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>
|
---|