QtBase
v6.3.1
|
The QStatusBar class provides a horizontal bar suitable for presenting status information. More...
#include <qstatusbar.h>
Public Slots | |
void | showMessage (const QString &text, int timeout=0) |
void | clearMessage () |
Public Slots inherited from QWidget | |
void | setEnabled (bool) |
void | setDisabled (bool) |
void | setWindowModified (bool) |
void | setWindowTitle (const QString &) |
void | setStyleSheet (const QString &styleSheet) |
void | setFocus () |
void | update () |
void | repaint () |
virtual void | setVisible (bool visible) |
void | setHidden (bool hidden) |
void | show () |
void | hide () |
void | showMinimized () |
void | showMaximized () |
void | showFullScreen () |
void | showNormal () |
bool | close () |
void | raise () |
void | lower () |
Public Slots inherited from QObject | |
void | deleteLater () |
Signals | |
void | messageChanged (const QString &text) |
Signals inherited from QWidget | |
void | windowTitleChanged (const QString &title) |
void | windowIconChanged (const QIcon &icon) |
void | windowIconTextChanged (const QString &iconText) |
void | customContextMenuRequested (const QPoint &pos) |
Signals inherited from QObject | |
void | destroyed (QObject *=nullptr) |
void | objectNameChanged (const QString &objectName, QPrivateSignal) |
Properties | |
bool | sizeGripEnabled |
whether the QSizeGrip in the bottom-right corner of the status bar is enabled More... | |
Properties inherited from QWidget | |
bool | modal |
whether the widget is a modal widget More... | |
Qt::WindowModality | windowModality |
which windows are blocked by the modal widget More... | |
bool | enabled |
whether the widget is enabled More... | |
QRect | geometry |
the geometry of the widget relative to its parent and excluding the window frame More... | |
QRect | frameGeometry |
geometry of the widget relative to its parent including any window frame More... | |
QRect | normalGeometry |
the geometry of the widget as it will appear when shown as a normal (not maximized or full screen) top-level widget More... | |
int | x |
the x coordinate of the widget relative to its parent including any window frame More... | |
int | y |
the y coordinate of the widget relative to its parent and including any window frame More... | |
QPoint | pos |
the position of the widget within its parent widget More... | |
QSize | frameSize |
the size of the widget including any window frame More... | |
QSize | size |
the size of the widget excluding any window frame More... | |
int | width |
the width of the widget excluding any window frame More... | |
int | height |
the height of the widget excluding any window frame More... | |
QRect | rect |
the internal geometry of the widget excluding any window frame More... | |
QRect | childrenRect |
the bounding rectangle of the widget's children More... | |
QRegion | childrenRegion |
the combined region occupied by the widget's children More... | |
QSizePolicy | sizePolicy |
the default layout behavior of the widget More... | |
QSize | minimumSize |
the widget's minimum size More... | |
QSize | maximumSize |
the widget's maximum size in pixels More... | |
int | minimumWidth |
the widget's minimum width in pixels More... | |
int | minimumHeight |
the widget's minimum height in pixels More... | |
int | maximumWidth |
the widget's maximum width in pixels More... | |
int | maximumHeight |
the widget's maximum height in pixels More... | |
QSize | sizeIncrement |
the size increment of the widget More... | |
QSize | baseSize |
the base size of the widget More... | |
QPalette | palette |
the widget's palette More... | |
QFont | font |
the font currently set for the widget More... | |
QCursor | cursor |
the cursor shape for this widget More... | |
bool | mouseTracking |
whether mouse tracking is enabled for the widget More... | |
bool | tabletTracking |
whether tablet tracking is enabled for the widget More... | |
bool | isActiveWindow |
whether this widget's window is the active window More... | |
Qt::FocusPolicy | focusPolicy |
the way the widget accepts keyboard focus More... | |
bool | focus |
whether this widget (or its focus proxy) has the keyboard input focus More... | |
Qt::ContextMenuPolicy | contextMenuPolicy |
how the widget shows a context menu More... | |
bool | updatesEnabled |
whether updates are enabled More... | |
bool | visible |
whether the widget is visible More... | |
bool | minimized |
whether this widget is minimized (iconified) More... | |
bool | maximized |
whether this widget is maximized More... | |
bool | fullScreen |
whether the widget is shown in full screen mode More... | |
QSize | sizeHint |
the recommended size for the widget More... | |
QSize | minimumSizeHint |
the recommended minimum size for the widget More... | |
bool | acceptDrops |
whether drop events are enabled for this widget More... | |
QString | windowTitle |
the window title (caption) More... | |
QIcon | windowIcon |
the widget's icon More... | |
QString | windowIconText |
the text to be displayed on the icon of a minimized window More... | |
double | windowOpacity |
The level of opacity for the window. More... | |
bool | windowModified |
whether the document shown in the window has unsaved changes More... | |
QString | accessibleName |
the widget's name as seen by assistive technologies More... | |
QString | accessibleDescription |
the widget's description as seen by assistive technologies More... | |
Qt::LayoutDirection | layoutDirection |
the layout direction for this widget. More... | |
bool | autoFillBackground |
whether the widget background is filled automatically More... | |
QString | styleSheet |
the widget's style sheet More... | |
QLocale | locale |
the widget's locale More... | |
QString | windowFilePath |
the file path associated with a widget More... | |
Qt::InputMethodHints | inputMethodHints |
What input method specific hints the widget has. More... | |
Properties inherited from QObject | |
QString | objectName |
the name of this object More... | |
The QStatusBar class provides a horizontal bar suitable for presenting status information.
\inmodule QtWidgets
Each status indicator falls into one of three categories:
\list
QStatusBar lets you display all three types of indicators.
Typically, a request for the status bar functionality occurs in relation to a QMainWindow object. QMainWindow provides a main application window, with a menu bar, tool bars, dock widgets and a status bar around a large central widget. The status bar can be retrieved using the QMainWindow::statusBar() function, and replaced using the QMainWindow::setStatusBar() function.
Use the showMessage() slot to display a temporary message:
To remove a temporary message, use the clearMessage() slot, or set a time limit when calling showMessage(). For example:
Use the currentMessage() function to retrieve the temporary message currently shown. The QStatusBar class also provide the messageChanged() signal which is emitted whenever the temporary status message changes.
\target permanent message Normal and Permanent messages are displayed by creating a small widget (QLabel, QProgressBar or even QToolButton) and then adding it to the status bar using the addWidget() or the addPermanentWidget() function. Use the removeWidget() function to remove such messages from the status bar.
By default QStatusBar provides a QSizeGrip in the lower-right corner. You can disable it using the setSizeGripEnabled() function. Use the isSizeGripEnabled() function to determine the current status of the size grip.
A status bar shown in the Fusion widget style
Definition at line 52 of file qstatusbar.h.
Constructs a status bar with a size grip and the given parent.
Definition at line 227 of file qstatusbar.cpp.
|
virtual |
Destroys this status bar and frees any allocated resources and child widgets.
Definition at line 246 of file qstatusbar.cpp.
Adds the given widget permanently to this status bar, reparenting the widget if it isn't already a child of this QStatusBar object. The stretch parameter is used to compute a suitable size for the given widget as the status bar grows and shrinks. The default stretch factor is 0, i.e giving the widget a minimum of space.
Permanently means that the widget may not be obscured by temporary messages. It is is located at the far right of the status bar.
Definition at line 330 of file qstatusbar.cpp.
Adds the given widget to this status bar, reparenting the widget if it isn't already a child of this QStatusBar object. The stretch parameter is used to compute a suitable size for the given widget as the status bar grows and shrinks. The default stretch factor is 0, i.e giving the widget a minimum of space.
The widget is located to the far left of the first permanent widget (see addPermanentWidget()) and may be obscured by temporary messages.
Definition at line 265 of file qstatusbar.cpp.
|
slot |
Removes any temporary message being shown.
Definition at line 563 of file qstatusbar.cpp.
QString QStatusBar::currentMessage | ( | ) | const |
Returns the temporary message currently shown, or an empty string if there is no such message.
Definition at line 582 of file qstatusbar.cpp.
|
overrideprotectedvirtual |
\reimp
Reimplemented from QWidget.
Definition at line 691 of file qstatusbar.cpp.
|
protected |
Ensures that the right widgets are visible.
Used by the showMessage() and clearMessage() functions.
Definition at line 604 of file qstatusbar.cpp.
int QStatusBar::insertPermanentWidget | ( | int | index, |
QWidget * | widget, | ||
int | stretch = 0 |
||
) |
Inserts the given widget at the given index permanently to this status bar, reparenting the widget if it isn't already a child of this QStatusBar object. If index is out of range, the widget is appended (in which case it is the actual index of the widget that is returned).
The stretch parameter is used to compute a suitable size for the given widget as the status bar grows and shrinks. The default stretch factor is 0, i.e giving the widget a minimum of space.
Permanently means that the widget may not be obscured by temporary messages. It is is located at the far right of the status bar.
Definition at line 356 of file qstatusbar.cpp.
int QStatusBar::insertWidget | ( | int | index, |
QWidget * | widget, | ||
int | stretch = 0 |
||
) |
Inserts the given widget at the given index to this status bar, reparenting the widget if it isn't already a child of this QStatusBar object. If index is out of range, the widget is appended (in which case it is the actual index of the widget that is returned).
The stretch parameter is used to compute a suitable size for the given widget as the status bar grows and shrinks. The default stretch factor is 0, i.e giving the widget a minimum of space.
The widget is located to the far left of the first permanent widget (see addPermanentWidget()) and may be obscured by temporary messages.
Definition at line 291 of file qstatusbar.cpp.
bool QStatusBar::isSizeGripEnabled | ( | ) | const |
Definition at line 422 of file qstatusbar.cpp.
This signal is emitted whenever the temporary status message changes. The new temporary message is passed in the message parameter which is a null-string when the message has been removed.
|
overrideprotectedvirtual |
\reimp
Shows the temporary message, if appropriate, in response to the paint event.
Reimplemented from QWidget.
Definition at line 651 of file qstatusbar.cpp.
|
protected |
Changes the status bar's appearance to account for item changes.
Special subclasses may need this function, but geometry management will usually take care of any necessary rearrangements.
Definition at line 463 of file qstatusbar.cpp.
Removes the specified widget from the status bar.
Definition at line 388 of file qstatusbar.cpp.
|
overrideprotectedvirtual |
\reimp
Reimplemented from QWidget.
Definition at line 682 of file qstatusbar.cpp.
void QStatusBar::setSizeGripEnabled | ( | bool | enabled | ) |
|
overrideprotectedvirtual |
Hides the normal status indications and displays the given message for the specified number of milli-seconds ({timeout}). If {timeout} is 0 (default), the {message} remains displayed until the clearMessage() slot is called or until the showMessage() slot is called again to change the message.
Note that showMessage() is called to show temporary explanations of tool tip texts, so passing a {timeout} of 0 is not sufficient to display a \l{permanent message}{permanent message}.
Definition at line 536 of file qstatusbar.cpp.
|
readwrite |
whether the QSizeGrip in the bottom-right corner of the status bar is enabled
The size grip is enabled by default.
Definition at line 95 of file qstatusbar.h.