QGIS API Documentation 3.41.0-Master (cea29feecf2)
Loading...
Searching...
No Matches
qgsstatusbar.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsstatusbar.h
3 --------------
4 begin : May 2017
5 copyright : (C) 2017 by Nyall Dawson
6 email : nyall dot dawson at gmail dot com
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18#ifndef QGSSTATUSBAR_H
19#define QGSSTATUSBAR_H
20
21#include "qgis_gui.h"
22#include "qgis_sip.h"
23#include <QWidget>
24
25class QHBoxLayout;
26class QLineEdit;
27class QStatusBar;
28
45class GUI_EXPORT QgsStatusBar : public QWidget
46{
47 Q_OBJECT
48
49 public:
51 enum Anchor
52 {
53 AnchorLeft = 0,
55 };
56
60 QgsStatusBar( QWidget *parent SIP_TRANSFERTHIS = nullptr );
61
71 void addPermanentWidget( QWidget *widget SIP_TRANSFER, int stretch = 0, Anchor anchor = AnchorRight );
72
77 void removeWidget( QWidget *widget );
78
83 QString currentMessage() const;
84
85 public slots:
86
94 void showMessage( const QString &message, int timeout = 0 );
95
100 void clearMessage();
101
109 void setParentStatusBar( QStatusBar *statusBar );
110
111
112 protected:
113 void changeEvent( QEvent *event ) override;
114
115 private:
116 QHBoxLayout *mLayout = nullptr;
117 QLineEdit *mLineEdit = nullptr;
118 QTimer *mTempMessageTimer = nullptr;
119 QStatusBar *mParentStatusBar = nullptr;
120 QMetaObject::Connection mShowMessageConnection;
121};
122
123#endif // QGSSTATUSBAR_H
A proxy widget for QStatusBar.
Anchor
Placement anchor for widgets.
@ AnchorRight
Anchor widget to right of status bar.
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53
#define SIP_TRANSFER
Definition qgis_sip.h:36