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"><!--
|
---|
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>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
|
---|
35 | contain decorated windows, e.g. for MDI.
|
---|
36 | <a href="#details">More...</a>
|
---|
37 | <p><tt>#include <<a href="qworkspace-h.html">qworkspace.h</a>></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 * parent = 0, const char * 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 <em>(obsolete)</em></li>
|
---|
47 | <li class=fn>QWidgetList <a href="#windowList"><b>windowList</b></a> ( WindowOrder 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 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 * w )</li>
|
---|
63 | </ul>
|
---|
64 | <h2>Properties</h2>
|
---|
65 | <ul>
|
---|
66 | <li class=fn>bool <a href="#scrollBarsEnabled-prop"><b>scrollBarsEnabled</b></a> - whether the workspace provides scrollbars</li>
|
---|
67 | </ul>
|
---|
68 | <hr><a name="details"></a><h2>Detailed Description</h2>
|
---|
69 |
|
---|
70 |
|
---|
71 | The QWorkspace widget provides a workspace window that can
|
---|
72 | contain decorated windows, e.g. for MDI.
|
---|
73 | <p>
|
---|
74 | <p>
|
---|
75 |
|
---|
76 |
|
---|
77 | <p> MDI (multiple document interface) applications typically have one
|
---|
78 | main window with a menu bar and toolbar, and a central widget that
|
---|
79 | is a QWorkspace. The workspace itself contains zero, one or more
|
---|
80 | document windows, each of which is a widget.
|
---|
81 | <p> The workspace itself is an ordinary Qt widget. It has a standard
|
---|
82 | constructor that takes a parent widget and an object name. The
|
---|
83 | parent 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
|
---|
85 | which 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
|
---|
87 | window, it is shown, hidden, etc. with a frame, caption, icon and
|
---|
88 | icon text, just as you'd expect. You can provide widget flags
|
---|
89 | which will be used for the layout of the decoration or the
|
---|
90 | behaviour of the widget itself.
|
---|
91 | <p> To change or retrieve the geometry of MDI windows you must operate
|
---|
92 | on the MDI widget's <a href="qwidget.html#parentWidget">parentWidget</a>(). (The parentWidget() provides
|
---|
93 | access to the decorated window in which the MDI window's widget is
|
---|
94 | shown.)
|
---|
95 | <p> A document window becomes active when it gets the <a href="focus.html#keyboard-focus">keyboard focus</a>.
|
---|
96 | You can also activate a window in code using <a href="qwidget.html#setFocus">setFocus</a>(). The user
|
---|
97 | can activate a window by moving focus in the usual ways, for
|
---|
98 | example by clicking a window or by pressing Tab. The workspace
|
---|
99 | emits a signal <a href="#windowActivated">windowActivated</a>() when it detects the activation
|
---|
100 | change, and the function <a href="#activeWindow">activeWindow</a>() always returns a pointer
|
---|
101 | to the active document window.
|
---|
102 | <p> The convenience function <a href="#windowList">windowList</a>() returns a list of all
|
---|
103 | document 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
|
---|
106 | windows: <a href="#cascade">cascade</a>() and <a href="#tile">tile</a>(). Both are slots so you can easily
|
---|
107 | connect menu entries to them.
|
---|
108 | <p> If you want your users to be able to work with document windows
|
---|
109 | larger than the actual workspace, set the scrollBarsEnabled
|
---|
110 | property to TRUE.
|
---|
111 | <p> If the top-level window contains a menu bar and a document window
|
---|
112 | is maximised, QWorkspace moves the document window's minimize,
|
---|
113 | restore and close buttons from the document window's frame to the
|
---|
114 | workspace window's menu bar. It then inserts a window operations
|
---|
115 | menu 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> * parent = 0, const char * name = 0 )
|
---|
128 | </h3>
|
---|
129 | Constructs 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>
|
---|
135 | Activates 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>
|
---|
140 | Activates 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> * <a name="activeWindow"></a>QWorkspace::activeWindow () const
|
---|
144 | </h3>
|
---|
145 | Returns 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>
|
---|
150 | Arranges 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>
|
---|
156 | Closes 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>
|
---|
161 | Closes all child windows.
|
---|
162 | <p> The windows are closed in random order. The operation stops if a
|
---|
163 | window 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.
|
---|
168 | See the <a href="qworkspace.html#scrollBarsEnabled-prop">"scrollBarsEnabled"</a> property for details.
|
---|
169 | <h3 class=fn>void <a name="setScrollBarsEnabled"></a>QWorkspace::setScrollBarsEnabled ( bool enable )
|
---|
170 | </h3><p>Sets whether the workspace provides scrollbars to <em>enable</em>.
|
---|
171 | See 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>
|
---|
174 | Arranges 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> * w )<tt> [signal]</tt>
|
---|
179 | </h3>
|
---|
180 |
|
---|
181 | <p> This signal is emitted when the window widget <em>w</em> becomes active.
|
---|
182 | Note that <em>w</em> can be null, and that more than one signal may be
|
---|
183 | emitted 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> order ) const
|
---|
187 | </h3>
|
---|
188 | Returns a list of all windows. If <em>order</em> is CreationOrder
|
---|
189 | (the default) the windows are listed in the order in which they
|
---|
190 | had been inserted into the workspace. If <em>order</em> is StackingOrder
|
---|
191 | the windows are listed in their stacking order, with the topmost window
|
---|
192 | being 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
|
---|
206 | windows over the right or the bottom edge out of the visible area
|
---|
207 | of the workspace. The workspace shows scrollbars to make it
|
---|
208 | possible for the user to access those windows. If this property is
|
---|
209 | set to FALSE (the default), resizing windows out of the visible
|
---|
210 | area 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>
|
---|
215 | This file is part of the <a href="index.html">Qt toolkit</a>.
|
---|
216 | Copyright © 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 © 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>
|
---|