QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
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 
28 class GUI_EXPORT QgsDockWidget : public QDockWidget
29 {
30  Q_OBJECT
31 
32  public:
33 
38  explicit QgsDockWidget( QWidget* parent = nullptr, Qt::WindowFlags flags = 0 );
39 
45  explicit QgsDockWidget( const QString &title, QWidget* parent = nullptr, Qt::WindowFlags flags = 0 );
46 
47  public slots:
48 
61  void setUserVisible( bool visible );
62 
67  bool isUserVisible() const;
68 
69  protected:
70 
71  virtual void closeEvent( QCloseEvent * ) override;
72  virtual void showEvent( QShowEvent* event ) override;
73 
74  signals:
75 
80  void closed();
81 
87  void closedStateChanged( bool wasClosed );
88 
93  void opened();
94 
100  void openedStateChanged( bool wasOpened );
101 
102  private slots:
103 
104  void handleVisibilityChanged( bool visible );
105 
106  private:
107 
108  bool mVisibleAndActive;
109 
110 };
111 #endif //QGSDOCKWIDGET_H
virtual void closeEvent(QCloseEvent *event)
virtual void showEvent(QShowEvent *event)
QgsDockWidget subclass with more fine-grained control over how the widget is closed or opened...
Definition: qgsdockwidget.h:28
typedef WindowFlags