source: trunk/doc/html/qworkspace.html@ 203

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

reference documentation added

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