1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/workspace/qworkspace.cpp:74 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>QWorkspace Class</title>
<style type="text/css"><!--
fn { margin-left: 1cm; text-indent: -1cm; }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
body { background: #ffffff; color: black; }
--></style>
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr bgcolor="#E5E5E5">
<td valign=center>
<a href="index.html">
<font color="#004faf">Home</font></a>
| <a href="classes.html">
<font color="#004faf">All Classes</font></a>
| <a href="mainclasses.html">
<font color="#004faf">Main Classes</font></a>
| <a href="annotated.html">
<font color="#004faf">Annotated</font></a>
| <a href="groups.html">
<font color="#004faf">Grouped Classes</font></a>
| <a href="functions.html">
<font color="#004faf">Functions</font></a>
</td>
<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QWorkspace Class Reference<br><small>[<a href="workspace.html">workspace module</a>]</small></h1>
<p>The QWorkspace widget provides a workspace window that can
contain decorated windows, e.g. for MDI.
<a href="#details">More...</a>
<p><tt>#include <<a href="qworkspace-h.html">qworkspace.h</a>></tt>
<p>Inherits <a href="qwidget.html">QWidget</a>.
<p><a href="qworkspace-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li class=fn><a href="#QWorkspace"><b>QWorkspace</b></a> ( QWidget * parent = 0, const char * name = 0 )</li>
<li class=fn><a href="#~QWorkspace"><b>~QWorkspace</b></a> ()</li>
<li class=fn>enum <a href="#WindowOrder-enum"><b>WindowOrder</b></a> { CreationOrder, StackingOrder }</li>
<li class=fn>QWidget * <a href="#activeWindow"><b>activeWindow</b></a> () const</li>
<li class=fn>QWidgetList windowList () const <em>(obsolete)</em></li>
<li class=fn>QWidgetList <a href="#windowList"><b>windowList</b></a> ( WindowOrder order ) const</li>
<li class=fn>bool <a href="#scrollBarsEnabled"><b>scrollBarsEnabled</b></a> () const</li>
<li class=fn>void <a href="#setScrollBarsEnabled"><b>setScrollBarsEnabled</b></a> ( bool enable )</li>
</ul>
<h2>Public Slots</h2>
<ul>
<li class=fn>void <a href="#cascade"><b>cascade</b></a> ()</li>
<li class=fn>void <a href="#tile"><b>tile</b></a> ()</li>
<li class=fn>void <a href="#closeActiveWindow"><b>closeActiveWindow</b></a> ()</li>
<li class=fn>void <a href="#closeAllWindows"><b>closeAllWindows</b></a> ()</li>
<li class=fn>void <a href="#activateNextWindow"><b>activateNextWindow</b></a> ()</li>
<li class=fn>void <a href="#activatePrevWindow"><b>activatePrevWindow</b></a> ()</li>
</ul>
<h2>Signals</h2>
<ul>
<li class=fn>void <a href="#windowActivated"><b>windowActivated</b></a> ( QWidget * w )</li>
</ul>
<h2>Properties</h2>
<ul>
<li class=fn>bool <a href="#scrollBarsEnabled-prop"><b>scrollBarsEnabled</b></a> - whether the workspace provides scrollbars</li>
</ul>
<hr><a name="details"></a><h2>Detailed Description</h2>
The QWorkspace widget provides a workspace window that can
contain decorated windows, e.g. for MDI.
<p>
<p>
<p> MDI (multiple document interface) applications typically have one
main window with a menu bar and toolbar, and a central widget that
is a QWorkspace. The workspace itself contains zero, one or more
document windows, each of which is a widget.
<p> The workspace itself is an ordinary Qt widget. It has a standard
constructor that takes a parent widget and an object name. The
parent window is usually a <a href="qmainwindow.html">QMainWindow</a>, but it need not be.
<p> Document windows (i.e. MDI windows) are also ordinary Qt widgets
which have the workspace as their parent widget. When you call
<a href="qwidget.html#show">show</a>(), <a href="qwidget.html#hide">hide</a>(), <a href="qwidget.html#showMaximized">showMaximized</a>(), <a href="qwidget.html#setCaption">setCaption</a>(), etc. on a document
window, it is shown, hidden, etc. with a frame, caption, icon and
icon text, just as you'd expect. You can provide widget flags
which will be used for the layout of the decoration or the
behaviour of the widget itself.
<p> To change or retrieve the geometry of MDI windows you must operate
on the MDI widget's <a href="qwidget.html#parentWidget">parentWidget</a>(). (The parentWidget() provides
access to the decorated window in which the MDI window's widget is
shown.)
<p> A document window becomes active when it gets the <a href="focus.html#keyboard-focus">keyboard focus</a>.
You can also activate a window in code using <a href="qwidget.html#setFocus">setFocus</a>(). The user
can activate a window by moving focus in the usual ways, for
example by clicking a window or by pressing Tab. The workspace
emits a signal <a href="#windowActivated">windowActivated</a>() when it detects the activation
change, and the function <a href="#activeWindow">activeWindow</a>() always returns a pointer
to the active document window.
<p> The convenience function <a href="#windowList">windowList</a>() returns a list of all
document windows. This is useful to create a popup menu
"<u>W</u>indows" on the fly, for example.
<p> QWorkspace provides two built-in layout strategies for child
windows: <a href="#cascade">cascade</a>() and <a href="#tile">tile</a>(). Both are slots so you can easily
connect menu entries to them.
<p> If you want your users to be able to work with document windows
larger than the actual workspace, set the scrollBarsEnabled
property to TRUE.
<p> If the top-level window contains a menu bar and a document window
is maximised, QWorkspace moves the document window's minimize,
restore and close buttons from the document window's frame to the
workspace window's menu bar. It then inserts a window operations
menu at the far left of the menu bar.
<p>See also <a href="application.html">Main Window and Related Classes</a> and <a href="organizers.html">Organizers</a>.
<hr><h2>Member Type Documentation</h2>
<h3 class=fn><a name="WindowOrder-enum"></a>QWorkspace::WindowOrder</h3>
<p> Specifies the order in which windows are returned from <a href="#windowList">windowList</a>().
<ul>
<li><tt>QWorkspace::CreationOrder</tt> - The windows are returned in the order of their creation
<li><tt>QWorkspace::StackingOrder</tt> - The windows are returned in the order of their stacking
</ul>
<hr><h2>Member Function Documentation</h2>
<h3 class=fn><a name="QWorkspace"></a>QWorkspace::QWorkspace ( <a href="qwidget.html">QWidget</a> * parent = 0, const char * name = 0 )
</h3>
Constructs a workspace with a <em>parent</em> and a <em>name</em>.
<h3 class=fn><a name="~QWorkspace"></a>QWorkspace::~QWorkspace ()
</h3> Destroys the workspace and frees any allocated resources.
<h3 class=fn>void <a name="activateNextWindow"></a>QWorkspace::activateNextWindow ()<tt> [slot]</tt>
</h3>
Activates the next window in the child window chain.
<p> <p>See also <a href="#activatePrevWindow">activatePrevWindow</a>().
<h3 class=fn>void <a name="activatePrevWindow"></a>QWorkspace::activatePrevWindow ()<tt> [slot]</tt>
</h3>
Activates the previous window in the child window chain.
<p> <p>See also <a href="#activateNextWindow">activateNextWindow</a>().
<h3 class=fn><a href="qwidget.html">QWidget</a> * <a name="activeWindow"></a>QWorkspace::activeWindow () const
</h3>
Returns the active window, or 0 if no window is active.
<p>Example: <a href="mdi-example.html#x2090">mdi/application.cpp</a>.
<h3 class=fn>void <a name="cascade"></a>QWorkspace::cascade ()<tt> [slot]</tt>
</h3>
Arranges all the child windows in a cascade pattern.
<p> <p>See also <a href="#tile">tile</a>().
<p>Example: <a href="mdi-example.html#x2091">mdi/application.cpp</a>.
<h3 class=fn>void <a name="closeActiveWindow"></a>QWorkspace::closeActiveWindow ()<tt> [slot]</tt>
</h3>
Closes the child window that is currently active.
<p> <p>See also <a href="#closeAllWindows">closeAllWindows</a>().
<h3 class=fn>void <a name="closeAllWindows"></a>QWorkspace::closeAllWindows ()<tt> [slot]</tt>
</h3>
Closes all child windows.
<p> The windows are closed in random order. The operation stops if a
window does not accept the close event.
<p> <p>See also <a href="#closeActiveWindow">closeActiveWindow</a>().
<h3 class=fn>bool <a name="scrollBarsEnabled"></a>QWorkspace::scrollBarsEnabled () const
</h3><p>Returns TRUE if the workspace provides scrollbars; otherwise returns FALSE.
See the <a href="qworkspace.html#scrollBarsEnabled-prop">"scrollBarsEnabled"</a> property for details.
<h3 class=fn>void <a name="setScrollBarsEnabled"></a>QWorkspace::setScrollBarsEnabled ( bool enable )
</h3><p>Sets whether the workspace provides scrollbars to <em>enable</em>.
See the <a href="qworkspace.html#scrollBarsEnabled-prop">"scrollBarsEnabled"</a> property for details.
<h3 class=fn>void <a name="tile"></a>QWorkspace::tile ()<tt> [slot]</tt>
</h3>
Arranges all child windows in a tile pattern.
<p> <p>See also <a href="#cascade">cascade</a>().
<p>Example: <a href="mdi-example.html#x2093">mdi/application.cpp</a>.
<h3 class=fn>void <a name="windowActivated"></a>QWorkspace::windowActivated ( <a href="qwidget.html">QWidget</a> * w )<tt> [signal]</tt>
</h3>
<p> This signal is emitted when the window widget <em>w</em> becomes active.
Note that <em>w</em> can be null, and that more than one signal may be
emitted for a single activation event.
<p> <p>See also <a href="#activeWindow">activeWindow</a>() and <a href="#windowList">windowList</a>().
<h3 class=fn>QWidgetList <a name="windowList"></a>QWorkspace::windowList ( <a href="qworkspace.html#WindowOrder-enum">WindowOrder</a> order ) const
</h3>
Returns a list of all windows. If <em>order</em> is CreationOrder
(the default) the windows are listed in the order in which they
had been inserted into the workspace. If <em>order</em> is StackingOrder
the windows are listed in their stacking order, with the topmost window
being the last window in the list.
<p> QWidgetList is the same as <a href="qptrlist.html">QPtrList</a><QWidget>.
<p> <p>See also <a href="qptrlist.html">QPtrList</a>.
<p>Example: <a href="mdi-example.html#x2094">mdi/application.cpp</a>.
<h3 class=fn>QWidgetList <a name="windowList-2"></a>QWorkspace::windowList () const
</h3>
<b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
<p> This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p>
<hr><h2>Property Documentation</h2>
<h3 class=fn>bool <a name="scrollBarsEnabled-prop"></a>scrollBarsEnabled</h3>
<p>This property holds whether the workspace provides scrollbars.
<p>If this property is set to TRUE, it is possible to resize child
windows over the right or the bottom edge out of the visible area
of the workspace. The workspace shows scrollbars to make it
possible for the user to access those windows. If this property is
set to FALSE (the default), resizing windows out of the visible
area of the workspace is not permitted.
<p>Set this property's value with <a href="#setScrollBarsEnabled">setScrollBarsEnabled</a>() and get this property's value with <a href="#scrollBarsEnabled">scrollBarsEnabled</a>().
<!-- eof -->
<hr><p>
This file is part of the <a href="index.html">Qt toolkit</a>.
Copyright © 1995-2007
<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
<table width=100% cellspacing=0 border=0><tr>
<td>Copyright © 2007
<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
<td align=right><div align=right>Qt 3.3.8</div>
</table></div></address></body>
</html>
|