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
4#ifndef QSTATUSBAR_H
5#define QSTATUSBAR_H
6
7#include <QtWidgets/qtwidgetsglobal.h>
8#include <QtWidgets/qwidget.h>
9
10QT_REQUIRE_CONFIG(statusbar);
11
12QT_BEGIN_NAMESPACE
13
14class QStatusBarPrivate;
15
16class Q_WIDGETS_EXPORT QStatusBar: public QWidget
17{
18 Q_OBJECT
19
20 Q_PROPERTY(bool sizeGripEnabled READ isSizeGripEnabled WRITE setSizeGripEnabled)
21
22public:
23 explicit QStatusBar(QWidget *parent = nullptr);
24 virtual ~QStatusBar();
25
26 void addWidget(QWidget *widget, int stretch = 0);
27 int insertWidget(int index, QWidget *widget, int stretch = 0);
28 void addPermanentWidget(QWidget *widget, int stretch = 0);
29 int insertPermanentWidget(int index, QWidget *widget, int stretch = 0);
30 void removeWidget(QWidget *widget);
31
32 void setSizeGripEnabled(bool);
33 bool isSizeGripEnabled() const;
34
35 QString currentMessage() const;
36
37public Q_SLOTS:
38 void showMessage(const QString &text, int timeout = 0);
39 void clearMessage();
40
41
42Q_SIGNALS:
43 void messageChanged(const QString &text);
44
45protected:
46 void showEvent(QShowEvent *) override;
47 void paintEvent(QPaintEvent *) override;
48 void resizeEvent(QResizeEvent *) override;
49
50 void reformat();
51 void hideOrShow();
52 bool event(QEvent *) override;
53
54private:
55 Q_DISABLE_COPY(QStatusBar)
56 Q_DECLARE_PRIVATE(QStatusBar)
57};
58
59QT_END_NAMESPACE
60
61#endif // QSTATUSBAR_H
62

source code of qtbase/src/widgets/widgets/qstatusbar.h