Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qstatusbar.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QSTATUSBAR_H
6#define QSTATUSBAR_H
7
8#include <QtWidgets/qtwidgetsglobal.h>
9#include <QtWidgets/qwidget.h>
10
12
13QT_BEGIN_NAMESPACE
14
15class QStatusBarPrivate;
16
17class Q_WIDGETS_EXPORT QStatusBar: public QWidget
18{
19 Q_OBJECT
20
21 Q_PROPERTY(bool sizeGripEnabled READ isSizeGripEnabled WRITE setSizeGripEnabled)
22
23public:
24 explicit QStatusBar(QWidget *parent = nullptr);
25 virtual ~QStatusBar();
26
27 void addWidget(QWidget *widget, int stretch = 0);
28 int insertWidget(int index, QWidget *widget, int stretch = 0);
29 void addPermanentWidget(QWidget *widget, int stretch = 0);
30 int insertPermanentWidget(int index, QWidget *widget, int stretch = 0);
31 void removeWidget(QWidget *widget);
32
33 void setSizeGripEnabled(bool);
34 bool isSizeGripEnabled() const;
35
36 QString currentMessage() const;
37
38public Q_SLOTS:
39 void showMessage(const QString &text, int timeout = 0);
40 void clearMessage();
41
42
43Q_SIGNALS:
44 void messageChanged(const QString &text);
45
46protected:
47 void showEvent(QShowEvent *) override;
48 void paintEvent(QPaintEvent *) override;
49 void resizeEvent(QResizeEvent *) override;
50
51 void reformat();
52 void hideOrShow();
53 bool event(QEvent *) override;
54
55private:
56 Q_DISABLE_COPY(QStatusBar)
57 Q_DECLARE_PRIVATE(QStatusBar)
58};
59
60QT_END_NAMESPACE
61
62#endif // QSTATUSBAR_H
Definition qlist.h:80
friend class QWidget
Definition qpainter.h:431
QRect messageRect() const
int indexToLastNonPermanentWidget() const
QList< SBItem > items
QBoxLayout * box
The QStatusBar class provides a horizontal bar suitable for presenting status information.
Definition qstatusbar.h:18
QT_REQUIRE_CONFIG(statusbar)