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

« back to all changes in this revision

Viewing changes to doc/html/q3dockarea.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/qt3support/widgets/q3dockarea.cpp -->
 
6
<head>
 
7
    <title>Qt 4.0: Q3DockArea 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">Q3DockArea Class Reference</h1>
 
21
<p>The Q3DockArea class manages and lays out Q3DockWindows. <a href="#details">More...</a></p>
 
22
<pre>#include &lt;Q3DockArea&gt;</pre><p><b>This class is part of the Qt 3 support library.</b> It is provided to keep old source code working. We strongly advise against using it in new code. See the <a href="porting4.html">Porting Guide</a> for more information.</p>
 
23
<p>Part of the <a href="qt3support.html">Qt3Support</a> module.</p>
 
24
<p>Inherits <a href="qwidget.html">QWidget</a>.</p>
 
25
<ul>
 
26
<li><a href="q3dockarea-members.html">List of all members, including inherited members</a></li>
 
27
</ul>
 
28
<a name="public-types"></a>
 
29
<h3>Public Types</h3>
 
30
<ul>
 
31
<li><div class="fn"/>enum <b><a href="q3dockarea.html#HandlePosition-enum">HandlePosition</a></b> { Normal, Reverse }</li>
 
32
</ul>
 
33
<a name="properties"></a>
 
34
<h3>Properties</h3>
 
35
<ul>
 
36
<li><div class="fn"/><b><a href="q3dockarea.html#count-prop">count</a></b> : const int</li>
 
37
<li><div class="fn"/><b><a href="q3dockarea.html#empty-prop">empty</a></b> : const bool</li>
 
38
<li><div class="fn"/><b><a href="q3dockarea.html#handlePosition-prop">handlePosition</a></b> : const HandlePosition</li>
 
39
<li><div class="fn"/><b><a href="q3dockarea.html#orientation-prop">orientation</a></b> : const Qt::Orientation</li>
 
40
</ul>
 
41
<ul>
 
42
<li><div class="fn"/>52 properties inherited from <a href="qwidget.html#properties">QWidget</a></li>
 
43
<li><div class="fn"/>1 property inherited from <a href="qobject.html#properties">QObject</a></li>
 
44
</ul>
 
45
<a name="public-functions"></a>
 
46
<h3>Public Functions</h3>
 
47
<ul>
 
48
<li><div class="fn"/><b><a href="q3dockarea.html#Q3DockArea">Q3DockArea</a></b> ( Qt::Orientation <i>o</i>, HandlePosition <i>h</i> = Normal, QWidget * <i>parent</i> = 0, const char * <i>name</i> = 0 )</li>
 
49
<li><div class="fn"/><b><a href="q3dockarea.html#dtor.Q3DockArea">~Q3DockArea</a></b> ()</li>
 
50
<li><div class="fn"/>int <b><a href="q3dockarea.html#count-prop">count</a></b> () const</li>
 
51
<li><div class="fn"/>QList&lt;Q3DockWindow *&gt; <b><a href="q3dockarea.html#dockWindowList">dockWindowList</a></b> () const</li>
 
52
<li><div class="fn"/>HandlePosition <b><a href="q3dockarea.html#handlePosition-prop">handlePosition</a></b> () const</li>
 
53
<li><div class="fn"/>bool <b><a href="q3dockarea.html#hasDockWindow">hasDockWindow</a></b> ( Q3DockWindow * <i>w</i>, int * <i>index</i> = 0 )</li>
 
54
<li><div class="fn"/>bool <b><a href="q3dockarea.html#isDockWindowAccepted">isDockWindowAccepted</a></b> ( Q3DockWindow * <i>dw</i> )</li>
 
55
<li><div class="fn"/>bool <b><a href="q3dockarea.html#empty-prop">isEmpty</a></b> () const</li>
 
56
<li><div class="fn"/>void <b><a href="q3dockarea.html#moveDockWindow">moveDockWindow</a></b> ( Q3DockWindow * <i>w</i>, int <i>index</i> = -1 )</li>
 
57
<li><div class="fn"/>void <b><a href="q3dockarea.html#moveDockWindow-2">moveDockWindow</a></b> ( Q3DockWindow * <i>w</i>, const QPoint &amp; <i>p</i>, const QRect &amp; <i>r</i>, bool <i>swap</i> )</li>
 
58
<li><div class="fn"/>Qt::Orientation <b><a href="q3dockarea.html#orientation-prop">orientation</a></b> () const</li>
 
59
<li><div class="fn"/>void <b><a href="q3dockarea.html#removeDockWindow">removeDockWindow</a></b> ( Q3DockWindow * <i>w</i>, bool <i>makeFloating</i>, bool <i>swap</i>, bool <i>fixNewLines</i> = true )</li>
 
60
<li><div class="fn"/>void <b><a href="q3dockarea.html#setAcceptDockWindow">setAcceptDockWindow</a></b> ( Q3DockWindow * <i>dw</i>, bool <i>accept</i> )</li>
 
61
</ul>
 
62
<ul>
 
63
<li><div class="fn"/>183 public functions inherited from <a href="qwidget.html#public-functions">QWidget</a></li>
 
64
<li><div class="fn"/>28 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
 
65
<li><div class="fn"/>10 public functions inherited from <a href="qpaintdevice.html#public-functions">QPaintDevice</a></li>
 
66
</ul>
 
67
<a name="public-slots"></a>
 
68
<h3>Public Slots</h3>
 
69
<ul>
 
70
<li><div class="fn"/>void <b><a href="q3dockarea.html#lineUp">lineUp</a></b> ( bool <i>keepNewLines</i> )</li>
 
71
</ul>
 
72
<ul>
 
73
<li><div class="fn"/>17 public slots inherited from <a href="qwidget.html#public-slots">QWidget</a></li>
 
74
<li><div class="fn"/>1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
 
75
</ul>
 
76
<a name="related-non-members"></a>
 
77
<h3>Related Non-Members</h3>
 
78
<ul>
 
79
<li><div class="fn"/>QTextStream &amp; <b><a href="q3dockarea.html#operator-lt-lt-88">operator&lt;&lt;</a></b> ( QTextStream &amp; <i>ts</i>, const Q3DockArea &amp; <i>dockArea</i> )</li>
 
80
<li><div class="fn"/>QTextStream &amp; <b><a href="q3dockarea.html#operator-gt-gt-61">operator&gt;&gt;</a></b> ( QTextStream &amp; <i>ts</i>, Q3DockArea &amp; <i>dockArea</i> )</li>
 
81
</ul>
 
82
<h3>Additional Inherited Members</h3>
 
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
<li><div class="fn"/>4 static public members inherited from <a href="qwidget.html#static-public-members">QWidget</a></li>
 
87
<li><div class="fn"/>4 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
 
88
<li><div class="fn"/>39 protected functions inherited from <a href="qwidget.html#protected-functions">QWidget</a></li>
 
89
<li><div class="fn"/>7 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
 
90
</ul>
 
91
<a name="details"></a>
 
92
<hr />
 
93
<h2>Detailed Description</h2>
 
94
<p>The Q3DockArea class manages and lays out Q3DockWindows.</p>
 
95
<p>A Q3DockArea is a container which manages a list of <a href="q3dockwindow.html">Q3DockWindow</a>s which it lays out within its area. In cooperation with the <a href="q3dockwindow.html">Q3DockWindow</a>s it is responsible for the docking and undocking of <a href="q3dockwindow.html">Q3DockWindow</a>s and moving them inside the dock area. Q3DockAreas also handle the wrapping of <a href="q3dockwindow.html">Q3DockWindow</a>s to fill the available space as compactly as possible. Q3DockAreas can contain Q3ToolBars since <a href="q3toolbar.html">Q3ToolBar</a> is a <a href="q3dockwindow.html">Q3DockWindow</a> subclass.</p>
 
96
<p><a href="qmainwindow.html">QMainWindow</a> contains four Q3DockAreas which you can use for your Q3ToolBars and Q3DockWindows, so in most situations you do not need to use the Q3DockArea class directly. Although <a href="qmainwindow.html">QMainWindow</a> contains support for its own dock areas it isn't convenient for adding new Q3DockAreas. If you need to create your own dock areas we suggest that you create a subclass of <a href="qwidget.html">QWidget</a> and add your Q3DockAreas to your subclass.</p>
 
97
<center><img src="images/qmainwindow-qdockareas.png" alt="QMainWindow's Q3DockAreas" /></center><a name="lines"></a><p><i>Lines</i>. Q3DockArea uses the concept of lines. A line is a horizontal region which may contain dock windows side-by-side. A dock area may have room for more than one line. When dock windows are docked into a dock area they are usually added at the right hand side of the top-most line that has room (unless manually placed by the user). When users move dock windows they may leave empty lines or gaps in non-empty lines. <a href="qt.html#Dock-enum">Qt::Dock</a> windows can be lined up to minimize wasted space using the <a href="q3dockarea.html#lineUp">lineUp</a>() function.</p>
 
98
<p>The Q3DockArea class maintains a position list of all its child dock windows. <a href="qt.html#Dock-enum">Qt::Dock</a> windows are added to a dock area from position 0 onwards. <a href="qt.html#Dock-enum">Qt::Dock</a> windows are laid out sequentially in position order from left to right, and in the case of multiple lines of dock windows, from top to bottom. If a dock window is floated it still retains its position since this is where the window will return if the user double clicks its caption. A dock window's position can be determined with <a href="q3dockarea.html#hasDockWindow">hasDockWindow</a>(). The position can be changed with <a href="q3dockarea.html#moveDockWindow">moveDockWindow</a>().</p>
 
99
<p>To dock or undock a dock window use <a href="q3dockwindow.html#dock">Q3DockWindow::dock</a>() and <a href="q3dockwindow.html#undock">Q3DockWindow::undock</a>() respectively. If you want to control which dock windows can dock in a dock area use <a href="q3dockarea.html#setAcceptDockWindow">setAcceptDockWindow</a>(). To see if a dock area contains a particular dock window use <a href="q3dockarea.html#hasDockWindow">hasDockWindow</a>(); to see how many dock windows a dock area contains use <a href="q3dockarea.html#count-prop">count</a>().</p>
 
100
<p>The streaming operators can write the positions of the dock windows in the dock area to a <a href="qtextstream.html">QTextStream</a>. The positions can be read back later to restore the saved positions.</p>
 
101
<p>Save the positions to a <a href="qtextstream.html">QTextStream</a>:</p>
 
102
<pre>&nbsp;   ts &lt;&lt; *myDockArea;</pre>
 
103
<p>Restore the positions from a <a href="qtextstream.html">QTextStream</a>:</p>
 
104
<pre>&nbsp;   ts &gt;&gt; *myDockArea;</pre>
 
105
<hr />
 
106
<h2>Member Type Documentation</h2>
 
107
<h3 class="fn"><a name="HandlePosition-enum"></a>enum Q3DockArea::HandlePosition</h3>
 
108
<p>A dock window has two kinds of handles, the dock window handle used for dragging the dock window, and the splitter handle used to resize the dock window in relation to other dock windows using a splitter. (The splitter handle is only visible for docked windows.)</p>
 
109
<p>This enum specifies where the dock window splitter handle is placed in the dock area.</p>
 
110
<table border="1" cellpadding="2" cellspacing="1" width="100%">
 
111
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
 
112
<tr><td valign="top"><tt>Q3DockArea::Normal</tt></td><td align="center" valign="top"><tt>0</tt></td><td valign="top">The splitter handles of dock windows are placed at the right or bottom.</td></tr>
 
113
<tr><td valign="top"><tt>Q3DockArea::Reverse</tt></td><td align="center" valign="top"><tt>1</tt></td><td valign="top">The splitter handles of dock windows are placed at the left or top.</td></tr>
 
114
</table>
 
115
<hr />
 
116
<h2>Property Documentation</h2>
 
117
<h3 class="fn"><a name="count-prop"></a>count : const int</h3>
 
118
<p>This property holds the number of dock windows in the dock area.</p>
 
119
<p>Access functions:</p>
 
120
<ul>
 
121
<li><div class="fn"/><b>int count () const</b></li>
 
122
</ul>
 
123
<h3 class="fn"><a name="empty-prop"></a>empty : const bool</h3>
 
124
<p>This property holds whether the dock area is empty.</p>
 
125
<p>Access functions:</p>
 
126
<ul>
 
127
<li><div class="fn"/><b>bool isEmpty () const</b></li>
 
128
</ul>
 
129
<h3 class="fn"><a name="handlePosition-prop"></a>handlePosition : const <a href="q3dockarea.html#HandlePosition-enum">HandlePosition</a></h3>
 
130
<p>This property holds where the dock window splitter handle is placed in the dock area.</p>
 
131
<p>The default position is <tt>Normal</tt>.</p>
 
132
<p>Access functions:</p>
 
133
<ul>
 
134
<li><div class="fn"/><b>HandlePosition handlePosition () const</b></li>
 
135
</ul>
 
136
<h3 class="fn"><a name="orientation-prop"></a>orientation : const <a href="qt.html#Orientation-enum">Qt::Orientation</a></h3>
 
137
<p>This property holds the dock area's orientation.</p>
 
138
<p>There is no default value; the orientation is specified in the constructor.</p>
 
139
<p>Access functions:</p>
 
140
<ul>
 
141
<li><div class="fn"/><b>Qt::Orientation orientation () const</b></li>
 
142
</ul>
 
143
<hr />
 
144
<h2>Member Function Documentation</h2>
 
145
<h3 class="fn"><a name="Q3DockArea"></a>Q3DockArea::Q3DockArea ( <a href="qt.html#Orientation-enum">Qt::Orientation</a> <i>o</i>, <a href="q3dockarea.html#HandlePosition-enum">HandlePosition</a> <i>h</i> = Normal, <a href="qwidget.html">QWidget</a> * <i>parent</i> = 0, const char * <i>name</i> = 0 )</h3>
 
146
<p>Constructs a <a href="q3dockarea.html">Q3DockArea</a> with orientation <i>o</i>, <a href="q3dockarea.html#HandlePosition-enum">HandlePosition</a> <i>h</i>, parent <i>parent</i> and called <i>name</i>.</p>
 
147
<h3 class="fn"><a name="dtor.Q3DockArea"></a>Q3DockArea::~Q3DockArea ()</h3>
 
148
<p>Destroys the dock area and all the dock windows docked in the dock area.</p>
 
149
<p>Does not affect any floating dock windows or dock windows in other dock areas, even if they first appeared in this dock area. Floating dock windows are effectively top level windows and are not child windows of the dock area. When a floating dock window is docked (dragged into a dock area) its parent becomes the dock area.</p>
 
150
<h3 class="fn"><a name="dockWindowList"></a><a href="qlist.html">QList</a>&lt;<a href="q3dockwindow.html">Q3DockWindow</a> *&gt; Q3DockArea::dockWindowList () const</h3>
 
151
<p>Returns a list of the dock windows in the dock area.</p>
 
152
<h3 class="fn"><a name="hasDockWindow"></a>bool Q3DockArea::hasDockWindow ( <a href="q3dockwindow.html">Q3DockWindow</a> * <i>w</i>, int * <i>index</i> = 0 )</h3>
 
153
<p>Returns true if the dock area contains the dock window <i>w</i>; otherwise returns false. If <i>index</i> is not 0 it will be set as follows: if the dock area contains the dock window *<i>index</i> is set to <i>w</i>'s index position; otherwise *<i>index</i> is set to -1.</p>
 
154
<h3 class="fn"><a name="isDockWindowAccepted"></a>bool Q3DockArea::isDockWindowAccepted ( <a href="q3dockwindow.html">Q3DockWindow</a> * <i>dw</i> )</h3>
 
155
<p>Returns true if dock window <i>dw</i> could be docked into the dock area; otherwise returns false.</p>
 
156
<p>See also <a href="q3dockarea.html#setAcceptDockWindow">setAcceptDockWindow</a>().</p>
 
157
<h3 class="fn"><a name="lineUp"></a>void Q3DockArea::lineUp ( bool <i>keepNewLines</i> )&nbsp;&nbsp;<tt> [slot]</tt></h3>
 
158
<p>Lines up the dock windows in this dock area to minimize wasted space. If <i>keepNewLines</i> is true, only space within lines is cleaned up. If <i>keepNewLines</i> is false the number of lines might be changed.</p>
 
159
<h3 class="fn"><a name="moveDockWindow"></a>void Q3DockArea::moveDockWindow ( <a href="q3dockwindow.html">Q3DockWindow</a> * <i>w</i>, int <i>index</i> = -1 )</h3>
 
160
<p>Moves the <a href="q3dockwindow.html">Q3DockWindow</a> <i>w</i> within the dock area. If <i>w</i> is not already docked in this area, <i>w</i> is docked first. If <i>index</i> is -1 or larger than the number of docked widgets, <i>w</i> is appended at the end, otherwise it is inserted at the position <i>index</i>.</p>
 
161
<h3 class="fn"><a name="moveDockWindow-2"></a>void Q3DockArea::moveDockWindow ( <a href="q3dockwindow.html">Q3DockWindow</a> * <i>w</i>, const <a href="qpoint.html">QPoint</a> &amp; <i>p</i>, const <a href="qrect.html">QRect</a> &amp; <i>r</i>, bool <i>swap</i> )</h3>
 
162
<p>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.</p>
 
163
<p>Moves the dock window <i>w</i> inside the dock area where <i>p</i> is the new position (in global screen coordinates), <i>r</i> is the suggested rectangle of the dock window and <i>swap</i> specifies whether or not the orientation of the docked widget needs to be changed.</p>
 
164
<p>This function is used internally by <a href="q3dockwindow.html">Q3DockWindow</a>. You shouldn't need to call it yourself.</p>
 
165
<h3 class="fn"><a name="removeDockWindow"></a>void Q3DockArea::removeDockWindow ( <a href="q3dockwindow.html">Q3DockWindow</a> * <i>w</i>, bool <i>makeFloating</i>, bool <i>swap</i>, bool <i>fixNewLines</i> = true )</h3>
 
166
<p>Removes the dock window <i>w</i> from the dock area. If <i>makeFloating</i> is true, <i>w</i> gets floated, and if <i>swap</i> is true, the orientation of <i>w</i> gets swapped. If <i>fixNewLines</i> is true (the default) newlines in the area will be fixed.</p>
 
167
<p>You should never need to call this function yourself. Use <a href="q3dockwindow.html#dock">Q3DockWindow::dock</a>() and <a href="q3dockwindow.html#undock">Q3DockWindow::undock</a>() instead.</p>
 
168
<h3 class="fn"><a name="setAcceptDockWindow"></a>void Q3DockArea::setAcceptDockWindow ( <a href="q3dockwindow.html">Q3DockWindow</a> * <i>dw</i>, bool <i>accept</i> )</h3>
 
169
<p>If <i>accept</i> is true, dock window <i>dw</i> can be docked in the dock area. If <i>accept</i> is false, dock window <i>dw</i> cannot be docked in the dock area.</p>
 
170
<p>See also <a href="q3dockarea.html#isDockWindowAccepted">isDockWindowAccepted</a>().</p>
 
171
<hr />
 
172
<h2>Related Non-Members</h2>
 
173
<h3 class="fn"><a name="operator-lt-lt-88"></a><a href="qtextstream.html">QTextStream</a> &amp; operator&lt;&lt; ( <a href="qtextstream.html">QTextStream</a> &amp; <i>ts</i>, const Q3DockArea &amp; <i>dockArea</i> )</h3>
 
174
<p>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.</p>
 
175
<p>Writes the layout of the dock windows in dock area <i>dockArea</i> to the text stream <i>ts</i>.</p>
 
176
<h3 class="fn"><a name="operator-gt-gt-61"></a><a href="qtextstream.html">QTextStream</a> &amp; operator&gt;&gt; ( <a href="qtextstream.html">QTextStream</a> &amp; <i>ts</i>, Q3DockArea &amp; <i>dockArea</i> )</h3>
 
177
<p>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.</p>
 
178
<p>Reads the layout description of the dock windows in dock area <i>dockArea</i> from the text stream <i>ts</i> and restores it. The layout description must have been previously written by the operator&lt;&lt;() function.</p>
 
179
<p /><address><hr /><div align="center">
 
180
<table width="100%" cellspacing="0" border="0"><tr class="address">
 
181
<td width="30%">Copyright &copy; 2005 <a href="trolltech.html">Trolltech</a></td>
 
182
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
 
183
<td width="30%" align="right"><div align="right">Qt 4.0.0</div></td>
 
184
</tr></table></div></address></body>
 
185
</html>