The QStatusBar class provides a horizontal bar suitable for presenting status information. More...
#include <qstatusbar.h>
Inherits QWidget.
Type | Name | READ | WRITE | Options |
---|---|---|---|---|
bool | sizeGripEnabled | isSizeGripEnabled | setSizeGripEnabled |
Each status indicator falls into one of three categories:
QStatusBar lets you display all three types of indicator.
To display a temporary 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 which displays the message until the next clear() or mesage(), and one which also has a time limit:
connect( loader, SIGNAL(progressMessage(const QString&)), statusBar(), SLOT(message(const QString&)) ); statusBar()->message("Loading..."); // Initial message loader.loadStuff(); // Emits progress messages statusBar()->message("Done.", 2000); // Final message for 2 seconds
Normal and permanent messages are displayed by creating a small widget 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.
statusBar()->addWidget(new MyReadWriteIndication(statusBar()));
By default, QStatusBar provides a QSizeGrip in the lower-right corner. You can disable this with setSizeGripEnabled(FALSE);
See also QToolBar, QMainWindow, QLabel and GUI Design Handbook: Status Bar.
Constructs a status bar with just a size grip.
See also setSizeGripEnabled().
Destructs the status bar and frees any allocated resources.
Adds widget to this status bar.
widget is permanently visible if permanent is TRUE, and is obscured by temporary messages if permanent is FALSE. The default is FALSE.
stretch is used to compute a suitable size for widget as the status bar grows and shrinks. The default of 0 uses a minimum of space.
If permanent is TRUE, widget is located at the far right of the status bar. If permanent is FALSE (the default) widget is located just to the left of the first permanent widget.
This function may cause some flicker.
See also removeWidget().
[slot]
Removes any temporary message being shown.
See also message().
[virtual protected]
Reimplemented for internal reasons; the API is not affected.
Reimplemented from QObject.
[protected]
Ensures that the right widgets are visible. Used by message() and clear().
Returns whether the QSizeGrip in the bottom right of the status bar is enabled.
See also setSizeGripEnabled().
[slot]
Hide the normal status indicators and display message, until clear() or another message() is called.
See also clear().
[slot]
Hide the normal status indications and display message for ms milli-seconds, or until clear() or another message() is called, whichever is first.
[virtual protected]
Shows the temporary message, if appropriate.
Reimplemented from QWidget.
[protected]
Changes the status bar's appearance to account for item changes. Special subclasses may need this, but normally geometry management will take care of any necessary rearrangements.
Removes widget from the status bar.
This function may cause some flicker.
Note that widget is not deleted.
See also addWidget().
[virtual protected]
Reimplemented for internal reasons; the API is not affected.
Reimplemented from QWidget.
Enables or disables the QSizeGrip in the bottom right of the status bar. By default, the size grip is enabled.
See also isSizeGripEnabled().
Search the documentation, FAQ, qt-interest archive and more (uses
www.trolltech.com):
This file is part of the Qt toolkit, copyright © 1995-2000 Trolltech, all rights reserved.
Copyright © 2000 Trolltech | Trademarks | Qt version 2.2.1
|