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
|
'\" t
.TH TQWidgetStack 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
TQWidgetStack \- Stack of widgets of which only the top widget is user-visible
.SH SYNOPSIS
\fC#include <tqwidgetstack.h>\fR
.PP
Inherits QFrame.
.PP
.SS "Public Members"
.in +1c
.ti -1c
.BI "\fBTQWidgetStack\fR ( TQWidget * parent = 0, const char * name = 0 )"
.br
.ti -1c
.BI "\fBTQWidgetStack\fR ( TQWidget * parent, const char * name, WFlags f )"
.br
.ti -1c
.BI "\fB~TQWidgetStack\fR ()"
.br
.ti -1c
.BI "int \fBaddWidget\fR ( TQWidget * w, int id = -1 )"
.br
.ti -1c
.BI "void \fBremoveWidget\fR ( TQWidget * w )"
.br
.ti -1c
.BI "TQWidget * \fBwidget\fR ( int id ) const"
.br
.ti -1c
.BI "int \fBid\fR ( TQWidget * widget ) const"
.br
.ti -1c
.BI "TQWidget * \fBvisibleWidget\fR () const"
.br
.in -1c
.SS "Public Slots"
.in +1c
.ti -1c
.BI "void \fBraiseWidget\fR ( int id )"
.br
.ti -1c
.BI "void \fBraiseWidget\fR ( TQWidget * w )"
.br
.in -1c
.SS "Signals"
.in +1c
.ti -1c
.BI "void \fBaboutToShow\fR ( int )"
.br
.ti -1c
.BI "void \fBaboutToShow\fR ( TQWidget * )"
.br
.in -1c
.SS "Protected Members"
.in +1c
.ti -1c
.BI "virtual void \fBsetChildGeometries\fR ()"
.br
.in -1c
.SH DESCRIPTION
The TQWidgetStack class provides a stack of widgets of which only the top widget is user-visible.
.PP
The application programmer can move any widget to the top of the stack at any time using raiseWidget(), and add or remove widgets using addWidget() and removeWidget(). It is not sufficient to pass the widget stack as parent to a widget which should be inserted into the widgetstack.
.PP
visibleWidget() is the \fIget\fR equivalent of raiseWidget(); it returns a pointer to the widget that is currently at the top of the stack.
.PP
TQWidgetStack also provides the ability to manipulate widgets through application-specified integer IDs. You can also translate from widget pointers to IDs using id() and from IDs to widget pointers using widget(). These numeric IDs are unique (per TQWidgetStack, not globally), but TQWidgetStack does not attach any additional meaning to them.
.PP
The default widget stack is frameless, but you can use the usual QFrame functions (such as setFrameStyle()) to add a frame.
.PP
TQWidgetStack provides a signal, aboutToShow(), which is emitted just before a managed widget is shown.
.PP
See also QTabDialog, QTabBar, QFrame, and Organizers.
.SH MEMBER FUNCTION DOCUMENTATION
.SH "TQWidgetStack::TQWidgetStack ( TQWidget * parent = 0, const char * name = 0 )"
Constructs an empty widget stack.
.PP
The \fIparent\fR and \fIname\fR arguments are passed to the QFrame constructor.
.SH "TQWidgetStack::TQWidgetStack ( TQWidget * parent, const char * name, WFlags f )"
Constructs an empty widget stack.
.PP
The \fIparent\fR, \fIname\fR and \fIf\fR arguments are passed to the QFrame constructor.
.SH "TQWidgetStack::~TQWidgetStack ()"
Destroys the object and frees any allocated resources.
.SH "void TQWidgetStack::aboutToShow ( int )\fC [signal]\fR"
This signal is emitted just before a managed widget is shown if that managed widget has an ID != -1. The argument is the numeric ID of the widget.
.PP
If you call visibleWidget() in a slot connected to aboutToShow(), the widget it returns is the one that is currently visible, not the one that is about to be shown.
.SH "void TQWidgetStack::aboutToShow ( TQWidget * )\fC [signal]\fR"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
This signal is emitted just before a managed widget is shown. The argument is a pointer to the widget.
.PP
If you call visibleWidget() in a slot connected to aboutToShow(), the widget returned is the one that is currently visible, not the one that is about to be shown.
.SH "int TQWidgetStack::addWidget ( TQWidget * w, int id = -1 )"
Adds widget \fIw\fR to this stack of widgets, with ID \fIid\fR.
.PP
If you pass an id >= 0 this ID is used. If you pass an \fIid\fR of -1 (the default), the widgets will be numbered automatically. If you pass -2 a unique negative integer will be generated. No widget has an ID of -1. Returns the ID or -1 on failure (e.g. \fIw\fR is 0).
.PP
If you pass an id that is already used, then a unique negative integer will be generated to prevent two widgets having the same id.
.PP
If \fIw\fR already exists in the stack the widget will be removed first.
.PP
If \fIw\fR is not a child of this TQWidgetStack moves it using reparent().
.PP
Example: xform/xform.cpp.
.SH "int TQWidgetStack::id ( TQWidget * widget ) const"
Returns the ID of the \fIwidget\fR. Returns -1 if \fIwidget\fR is 0 or is not being managed by this widget stack.
.PP
See also widget() and addWidget().
.SH "void TQWidgetStack::raiseWidget ( int id )\fC [slot]\fR"
Raises the widget with ID \fIid\fR to the top of the widget stack.
.PP
See also visibleWidget().
.PP
Example: xform/xform.cpp.
.SH "void TQWidgetStack::raiseWidget ( TQWidget * w )\fC [slot]\fR"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Raises widget \fIw\fR to the top of the widget stack.
.SH "void TQWidgetStack::removeWidget ( TQWidget * w )"
Removes widget \fIw\fR from this stack of widgets. Does not delete \fIw\fR. If \fIw\fR is the currently visible widget, no other widget is substituted.
.PP
See also visibleWidget() and raiseWidget().
.SH "void TQWidgetStack::setChildGeometries ()\fC [virtual protected]\fR"
Fixes up the children's geometries.
.SH "TQWidget * TQWidgetStack::visibleWidget () const"
Returns the currently visible widget (the one at the top of the stack), or 0 if nothing is currently being shown.
.PP
See also aboutToShow(), id(), and raiseWidget().
.SH "TQWidget * TQWidgetStack::widget ( int id ) const"
Returns the widget with ID \fIid\fR. Returns 0 if this widget stack does not manage a widget with ID \fIid\fR.
.PP
See also id() and addWidget().
.SH "SEE ALSO"
.BR http://doc.trolltech.com/tqwidgetstack.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 (tqwidgetstack.3qt) and the Qt
version (3.3.8).
|