summaryrefslogtreecommitdiffstats
path: root/doc/man/man3/tqworkspace.3qt
blob: 0a5964ab82ecd6f5cbfbb1ad4279f37ea7983baf (plain)
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
'\" t
.TH TQWorkspace 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*-
.\" Copyright 1992-2007 Trolltech ASA.  All rights reserved.  See the
.\" license file included in the distribution for a complete license
.\" statement.
.\"
.ad l
.nh
.SH NAME
TQWorkspace \- Workspace window that can contain decorated windows, e.g. for MDI
.SH SYNOPSIS
\fC#include <tqworkspace.h>\fR
.PP
Inherits TQWidget.
.PP
.SS "Public Members"
.in +1c
.ti -1c
.BI "\fBTQWorkspace\fR ( TQWidget * parent = 0, const char * name = 0 )"
.br
.ti -1c
.BI "\fB~TQWorkspace\fR ()"
.br
.ti -1c
.BI "enum \fBWindowOrder\fR { CreationOrder, StackingOrder }"
.br
.ti -1c
.BI "TQWidget * \fBactiveWindow\fR () const"
.br
.ti -1c
.BI "TQWidgetList windowList () const  \fI(obsolete)\fR"
.br
.ti -1c
.BI "TQWidgetList \fBwindowList\fR ( WindowOrder order ) const"
.br
.ti -1c
.BI "bool \fBscrollBarsEnabled\fR () const"
.br
.ti -1c
.BI "void \fBsetScrollBarsEnabled\fR ( bool enable )"
.br
.in -1c
.SS "Public Slots"
.in +1c
.ti -1c
.BI "void \fBcascade\fR ()"
.br
.ti -1c
.BI "void \fBtile\fR ()"
.br
.ti -1c
.BI "void \fBcloseActiveWindow\fR ()"
.br
.ti -1c
.BI "void \fBcloseAllWindows\fR ()"
.br
.ti -1c
.BI "void \fBactivateNextWindow\fR ()"
.br
.ti -1c
.BI "void \fBactivatePrevWindow\fR ()"
.br
.in -1c
.SS "Signals"
.in +1c
.ti -1c
.BI "void \fBwindowActivated\fR ( TQWidget * w )"
.br
.in -1c
.SS "Properties"
.in +1c
.ti -1c
.BI "bool \fBscrollBarsEnabled\fR - whether the workspace provides scrollbars"
.br
.in -1c
.SH DESCRIPTION
The TQWorkspace widget provides a workspace window that can contain decorated windows, e.g. for MDI.
.PP
MDI (multiple document interface) applications typically have one main window with a menu bar and toolbar, and a central widget that is a TQWorkspace. The workspace itself contains zero, one or more document windows, each of which is a widget.
.PP
The workspace itself is an ordinary TQt widget. It has a standard constructor that takes a parent widget and an object name. The parent window is usually a TQMainWindow, but it need not be.
.PP
Document windows (i.e. MDI windows) are also ordinary TQt widgets which have the workspace as their parent widget. When you call show(), hide(), showMaximized(), setCaption(), 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.
.PP
To change or retrieve the geometry of MDI windows you must operate on the MDI widget's parentWidget(). (The parentWidget() provides access to the decorated window in which the MDI window's widget is shown.)
.PP
A document window becomes active when it gets the keyboard focus. You can also activate a window in code using setFocus(). 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 windowActivated() when it detects the activation change, and the function activeWindow() always returns a pointer to the active document window.
.PP
The convenience function windowList() returns a list of all document windows. This is useful to create a popup menu" <u>W</u>indows" on the fly, for example.
.PP
TQWorkspace provides two built-in layout strategies for child windows: cascade() and tile(). Both are slots so you can easily connect menu entries to them.
.PP
If you want your users to be able to work with document windows larger than the actual workspace, set the scrollBarsEnabled property to TRUE.
.PP
If the top-level window contains a menu bar and a document window is maximised, TQWorkspace 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.
.PP
See also Main Window and Related Classes and Organizers.
.SS "Member Type Documentation"
.SH "TQWorkspace::WindowOrder"
Specifies the order in which windows are returned from windowList().
.TP
\fCTQWorkspace::CreationOrder\fR - The windows are returned in the order of their creation
.TP
\fCTQWorkspace::StackingOrder\fR - The windows are returned in the order of their stacking
.SH MEMBER FUNCTION DOCUMENTATION
.SH "TQWorkspace::TQWorkspace ( TQWidget * parent = 0, const char * name = 0 )"
Constructs a workspace with a \fIparent\fR and a \fIname\fR.
.SH "TQWorkspace::~TQWorkspace ()"
Destroys the workspace and frees any allocated resources.
.SH "void TQWorkspace::activateNextWindow ()\fC [slot]\fR"
Activates the next window in the child window chain.
.PP
See also activatePrevWindow().
.SH "void TQWorkspace::activatePrevWindow ()\fC [slot]\fR"
Activates the previous window in the child window chain.
.PP
See also activateNextWindow().
.SH "TQWidget * TQWorkspace::activeWindow () const"
Returns the active window, or 0 if no window is active.
.PP
Example: mdi/application.cpp.
.SH "void TQWorkspace::cascade ()\fC [slot]\fR"
Arranges all the child windows in a cascade pattern.
.PP
See also tile().
.PP
Example: mdi/application.cpp.
.SH "void TQWorkspace::closeActiveWindow ()\fC [slot]\fR"
Closes the child window that is currently active.
.PP
See also closeAllWindows().
.SH "void TQWorkspace::closeAllWindows ()\fC [slot]\fR"
Closes all child windows.
.PP
The windows are closed in random order. The operation stops if a window does not accept the close event.
.PP
See also closeActiveWindow().
.SH "bool TQWorkspace::scrollBarsEnabled () const"
Returns TRUE if the workspace provides scrollbars; otherwise returns FALSE. See the "scrollBarsEnabled" property for details.
.SH "void TQWorkspace::setScrollBarsEnabled ( bool enable )"
Sets whether the workspace provides scrollbars to \fIenable\fR. See the "scrollBarsEnabled" property for details.
.SH "void TQWorkspace::tile ()\fC [slot]\fR"
Arranges all child windows in a tile pattern.
.PP
See also cascade().
.PP
Example: mdi/application.cpp.
.SH "void TQWorkspace::windowActivated ( TQWidget * w )\fC [signal]\fR"
This signal is emitted when the window widget \fIw\fR becomes active. Note that \fIw\fR can be null, and that more than one signal may be emitted for a single activation event.
.PP
See also activeWindow() and windowList().
.SH "TQWidgetList TQWorkspace::windowList ( WindowOrder order ) const"
Returns a list of all windows. If \fIorder\fR is CreationOrder (the default) the windows are listed in the order in which they had been inserted into the workspace. If \fIorder\fR is StackingOrder the windows are listed in their stacking order, with the topmost window being the last window in the list.
.PP
TQWidgetList is the same as TQPtrList<TQWidget>.
.PP
See also TQPtrList.
.PP
Example: mdi/application.cpp.
.SH "TQWidgetList TQWorkspace::windowList () const"
\fBThis function is obsolete.\fR It is provided to keep old source working. We strongly advise against using it in new code.
.PP
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
.SS "Property Documentation"
.SH "bool scrollBarsEnabled"
This property holds whether the workspace provides scrollbars.
.PP
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.
.PP
Set this property's value with setScrollBarsEnabled() and get this property's value with scrollBarsEnabled().

.SH "SEE ALSO"
.BR http://doc.trolltech.com/tqworkspace.html
.BR http://www.trolltech.com/faq/tech.html
.SH COPYRIGHT
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com.  See the
license file included in the distribution for a complete license
statement.
.SH AUTHOR
Generated automatically from the source code.
.SH BUGS
If you find a bug in Qt, please report it as described in
.BR http://doc.trolltech.com/bughowto.html .
Good bug reports help us to help you. Thank you.
.P
The definitive TQt documentation is provided in HTML format; it is
located at $TQTDIR/doc/html and can be read using TQt Assistant or with
a web browser. This man page is provided as a convenience for those
users who prefer man pages, although this format is not officially
supported by Trolltech. 
.P
If you find errors in this manual page, please report them to
.BR [email protected] .
Please include the name of the manual page (tqworkspace.3qt) and the Qt
version (3.3.8).