Home · All Classes · Main Classes · Grouped Classes · Modules · Functions |
The QStatusBar class provides a horizontal bar suitable for presenting status information. More...
#include <QStatusBar>
Inherits QWidget.
The QStatusBar class provides a horizontal bar suitable for presenting status information.
Each status indicator falls into one of three categories:
QStatusBar lets you display all three types of indicators.
To display a temporary message, call showMessage() (perhaps by connecting a suitable signal to it). To remove a temporary message, call clearMessage(), or set a time limit when calling showMessage():
connect(loader, SIGNAL(progressMessage(QString)), statusBar(), SLOT(showMessage(QString))); statusBar()->showMessage("Loading..."); // Initial message loader.loadStuff(); // Emits progress messages statusBar()->showMessage("Done.", 2000); // Final message for 2 seconds
Normal and Permanent messages are displayed by creating a small widget and then adding it to the status bar with addWidget() or addPermanentWidget(). Widgets like QLabel, QProgressBar or even QToolButton are useful for adding to status bars. removeWidget() is used to remove widgets.
statusBar()->addWidget(new MyReadWriteIndication);
By default QStatusBar provides a QSizeGrip in the lower-right corner. You can disable it with setSizeGripEnabled(false);
See also QToolBar, QMainWindow, QLabel, and GUI Design Handbook: Status Bar.
This property holds whether the QSizeGrip in the bottom-right of the status bar is enabled.
Enables or disables the QSizeGrip in the bottom-right of the status bar. By default, the size grip is enabled.
Access functions:
Constructs a status bar with a size grip with the given parent.
See also setSizeGripEnabled().
Destroys the status bar and frees any allocated resources and child widgets.
Adds widget permanently to this status bar. widget is reparented if it isn't already a child of the QStatusBar.
Permanently means that the widget may not be obscured by temporary messages. It is is located at the far right of the status bar.
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.
This function may cause some flicker.
See also removeWidget() and addWidget().
Adds widget to this status bar. widget is reparented if it isn't already a child of the QStatusBar.
The widget is located just to the left of the first permanent widget (see addPermanentWidget()) and may be obscured by temporary messages.
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.
This function may cause some flicker.
See also removeWidget() and addPermanentWidget().
Removes any temporary message being shown.
See also showMessage().
Returns the temporary message currently shown, or an empty string if there is no such message.
Ensures that the right widgets are visible. Used by showMessage() and clearMessage().
This signal is emitted when the temporary status messages changes. message is the new temporary message, and is a null-string when the message has been removed.
See also showMessage() and clearMessage().
Shows the temporary message, if appropriate, in response to the paint event.
Reimplemented from QWidget.
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.
Removes widget from the status bar.
This function may cause some flicker.
Note that widget is not deleted.
See also addWidget().
Hides the normal status indications and displays message for timeout milli-seconds (if non-zero), or until clearMessage() or another showMessage() is called, whichever occurs first.
Copyright © 2005 Trolltech | Trademarks | Qt 4.1.0 |