QGIS API Documentation  3.2.0-Bonn (bc43194)
qgsdockwidget.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsdockwidget.h
3  ---------------
4  begin : June 2016
5  copyright : (C) 2016 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 #ifndef QGSDOCKWIDGET_H
18 #define QGSDOCKWIDGET_H
19 
20 #include <QDockWidget>
21 #include "qgis_gui.h"
22 #include "qgis.h"
23 
31 class GUI_EXPORT QgsDockWidget : public QDockWidget
32 {
33  Q_OBJECT
34 
35  public:
36 
42  explicit QgsDockWidget( QWidget *parent SIP_TRANSFERTHIS = nullptr, Qt::WindowFlags flags = nullptr );
43 
50  explicit QgsDockWidget( const QString &title, QWidget *parent SIP_TRANSFERTHIS = nullptr, Qt::WindowFlags flags = nullptr );
51 
58  bool isUserVisible() const;
59 
60  public slots:
61 
76  void setUserVisible( bool visible );
77 
87  void toggleUserVisible();
88 
89  protected:
90 
91  void closeEvent( QCloseEvent * ) override;
92  void showEvent( QShowEvent *event ) override;
93 
94  signals:
95 
101  void closed();
102 
109  void closedStateChanged( bool wasClosed );
110 
116  void opened();
117 
124  void openedStateChanged( bool wasOpened );
125 
126  private slots:
127 
128  void handleVisibilityChanged( bool visible );
129 
130  private:
131 
132  bool mVisibleAndActive = false;
133 
134 };
135 #endif //QGSDOCKWIDGET_H
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:46
QgsDockWidget subclass with more fine-grained control over how the widget is closed or opened...
Definition: qgsdockwidget.h:31