summaryrefslogtreecommitdiffstats
path: root/doc/man/man3/qstatusbar.3qt
blob: c6acaaec0cbc90a4ebeae6243d61340732aaaafd (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
197
198
199
200
201
202
203
204
205
206
207
208
209
'\" t
.TH QStatusBar 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
QStatusBar \- Horizontal bar suitable for presenting status information
.SH SYNOPSIS
\fC#include <qstatusbar.h>\fR
.PP
Inherits QWidget.
.PP
.SS "Public Members"
.in +1c
.ti -1c
.BI "\fBQStatusBar\fR ( QWidget * parent = 0, const char * name = 0 )"
.br
.ti -1c
.BI "virtual \fB~QStatusBar\fR ()"
.br
.ti -1c
.BI "virtual void \fBaddWidget\fR ( QWidget * widget, int stretch = 0, bool permanent = FALSE )"
.br
.ti -1c
.BI "virtual void \fBremoveWidget\fR ( QWidget * widget )"
.br
.ti -1c
.BI "void \fBsetSizeGripEnabled\fR ( bool )"
.br
.ti -1c
.BI "bool \fBisSizeGripEnabled\fR () const"
.br
.in -1c
.SS "Public Slots"
.in +1c
.ti -1c
.BI "void \fBmessage\fR ( const QString & message )"
.br
.ti -1c
.BI "void \fBmessage\fR ( const QString & message, int ms )"
.br
.ti -1c
.BI "void \fBclear\fR ()"
.br
.in -1c
.SS "Signals"
.in +1c
.ti -1c
.BI "void \fBmessageChanged\fR ( const QString & message )"
.br
.in -1c
.SS "Properties"
.in +1c
.ti -1c
.BI "bool \fBsizeGripEnabled\fR - whether the QSizeGrip in the bottom right of the status bar is enabled"
.br
.in -1c
.SS "Protected Members"
.in +1c
.ti -1c
.BI "virtual void \fBpaintEvent\fR ( QPaintEvent * )"
.br
.ti -1c
.BI "void \fBreformat\fR ()"
.br
.ti -1c
.BI "void \fBhideOrShow\fR ()"
.br
.in -1c
.SH DESCRIPTION
The QStatusBar class provides a horizontal bar suitable for presenting status information.
.PP
Each status indicator falls into one of three categories:
.TP
\fITemporary\fR - briefly occupies most of the status bar. Used to explain tool tip texts or menu entries, for example.
.TP
\fINormal\fR - occupies part of the status bar and may be hidden by temporary messages. Used to display the page and line number in a word processor, for example.
.TP
\fIPermanent\fR - is never hidden. Used for important mode indications, for example, some applications put a Caps Lock indicator in the status bar.
.PP
QStatusBar lets you display all three types of indicators.
.PP
To display a \fItemporary\fR message, call message() (perhaps by connecting a suitable signal to it). To remove a temporary message, call clear(). There are two variants of message(): one that displays the message until the next clear() or message() and one that has a time limit:
.PP
.nf
.br
        connect( loader, SIGNAL(progressMessage(const QString&)),
.br
                 statusBar(), SLOT(message(const QString&)) );
.br
.br
        statusBar()->message("Loading...");  // Initial message
.br
        loader.loadStuff();                  // Emits progress messages
.br
        statusBar()->message("Done.", 2000); // Final message for 2 seconds
.br
.fi
.PP
\fINormal\fR and \fIPermanent\fR messages are displayed by creating a small widget and then adding it to the status bar with addWidget(). Widgets like QLabel, QProgressBar or even QToolButton are useful for adding to status bars. removeWidget() is used to remove widgets.
.PP
.nf
.br
        statusBar()->addWidget(new MyReadWriteIndication(statusBar()));
.br
.fi
.PP
By default QStatusBar provides a QSizeGrip in the lower-right corner. You can disable it with setSizeGripEnabled(FALSE);
.PP
.ce 1
.B "[Image Omitted]"
.PP

.ce 1
.B "[Image Omitted]"
.PP
See also QToolBar, QMainWindow, QLabel, GUI Design Handbook: Status Bar, Main Window and Related Classes, and Help System.
.SH MEMBER FUNCTION DOCUMENTATION
.SH "QStatusBar::QStatusBar ( QWidget * parent = 0, const char * name = 0 )"
Constructs a status bar called \fIname\fR with parent \fIparent\fR and with a size grip.
.PP
See also sizeGripEnabled.
.SH "QStatusBar::~QStatusBar ()\fC [virtual]\fR"
Destroys the status bar and frees any allocated resources and child widgets.
.SH "void QStatusBar::addWidget ( QWidget * widget, int stretch = 0, bool permanent = FALSE )\fC [virtual]\fR"
Adds \fIwidget\fR to this status bar. \fIwidget\fR is reparented if it isn't already a child of the QStatusBar.
.PP
\fIwidget\fR is permanently visible if \fIpermanent\fR is TRUE and may be obscured by temporary messages if \fIpermanent\fR is FALSE. The default is FALSE.
.PP
If \fIpermanent\fR is TRUE, \fIwidget\fR is located at the far right of the status bar. If \fIpermanent\fR is FALSE (the default), \fIwidget\fR is located just to the left of the first permanent widget.
.PP
\fIstretch\fR is used to compute a suitable size for \fIwidget\fR as the status bar grows and shrinks. The default of 0 uses a minimum of space.
.PP
This function may cause some flicker.
.PP
See also removeWidget().
.SH "void QStatusBar::clear ()\fC [slot]\fR"
Removes any temporary message being shown.
.PP
See also message().
.SH "void QStatusBar::hideOrShow ()\fC [protected]\fR"
Ensures that the right widgets are visible. Used by message() and clear().
.SH "bool QStatusBar::isSizeGripEnabled () const"
Returns TRUE if the QSizeGrip in the bottom right of the status bar is enabled; otherwise returns FALSE. See the "sizeGripEnabled" property for details.
.SH "void QStatusBar::message ( const QString & message )\fC [slot]\fR"
Hides the normal status indicators and displays \fImessage\fR until clear() or another message() is called.
.PP
See also clear().
.PP
Example: regexptester/regexptester.cpp.
.SH "void QStatusBar::message ( const QString & message, int ms )\fC [slot]\fR"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Hides the normal status indications and displays \fImessage\fR for \fIms\fR milli-seconds or until clear() or another message() is called, whichever occurs first.
.SH "void QStatusBar::messageChanged ( const QString & message )\fC [signal]\fR"
This signal is emitted when the temporary status messages changes. \fImessage\fR is the new temporary message, and is a null-string when the message has been removed.
.PP
See also message() and clear().
.SH "void QStatusBar::paintEvent ( QPaintEvent * )\fC [virtual protected]\fR"
Shows the temporary message, if appropriate.
.PP
Reimplemented from QWidget.
.SH "void QStatusBar::reformat ()\fC [protected]\fR"
Changes the status bar's appearance to account for item changes. Special subclasses may need this, but geometry management will usually take care of any necessary rearrangements.
.SH "void QStatusBar::removeWidget ( QWidget * widget )\fC [virtual]\fR"
Removes \fIwidget\fR from the status bar.
.PP
This function may cause some flicker.
.PP
Note that \fIwidget\fR is not deleted.
.PP
See also addWidget().
.SH "void QStatusBar::setSizeGripEnabled ( bool )"
Sets whether the QSizeGrip in the bottom right of the status bar is enabled. See the "sizeGripEnabled" property for details.
.SS "Property Documentation"
.SH "bool sizeGripEnabled"
This property holds whether the QSizeGrip in the bottom right of the status bar is enabled.
.PP
Enables or disables the QSizeGrip in the bottom right of the status bar. By default, the size grip is enabled.
.PP
Set this property's value with setSizeGripEnabled() and get this property's value with isSizeGripEnabled().

.SH "SEE ALSO"
.BR http://doc.trolltech.com/qstatusbar.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 Qt documentation is provided in HTML format; it is
located at $QTDIR/doc/html and can be read using Qt 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 (qstatusbar.3qt) and the Qt
version (3.3.8).