QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
qgspanelwidget.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgspanelwidget.h
3  ---------------------
4  begin : June 2016
5  copyright : (C) 2016 by Nathan Woodrow
6  email :
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 #ifndef QGSPANELWIDGET_H
16 #define QGSPANELWIDGET_H
17 
18 #include <QWidget>
19 #include <QKeyEvent>
20 #include <QStack>
21 
25 class GUI_EXPORT QgsPanelWidget : public QWidget
26 {
27  Q_OBJECT
28  public:
33  QgsPanelWidget( QWidget *parent = 0 );
34 
39  void setPanelTitle( QString panelTitle ) { mPanelTitle = panelTitle; }
40 
45  QString panelTitle() { return mPanelTitle; }
46 
54  void connectChildPanels( QList<QgsPanelWidget*> panels );
55 
63  void connectChildPanel( QgsPanelWidget* panel );
64 
70  virtual void setDockMode( bool dockMode );
71 
78  bool dockMode() { return mDockMode; }
79 
86  void setAutoDelete( bool autoDelete ) { mAutoDelete = autoDelete; }
87 
94  bool autoDelete() { return mAutoDelete; }
95 
102  static QgsPanelWidget* findParentPanel( QWidget* widget );
103 
104  signals:
105 
115  void panelAccepted( QgsPanelWidget* panel );
116 
123  void showPanel( QgsPanelWidget* panel );
124 
131  void widgetChanged();
132 
133  public slots:
144  void openPanel( QgsPanelWidget* panel );
145 
150  void acceptPanel();
151 
152  protected:
153 
158  void keyPressEvent( QKeyEvent* event );
159 
160  private:
161  bool mAutoDelete;
162  QString mPanelTitle;
163  bool mDockMode;
164 
165 };
166 
167 
175 class GUI_EXPORT QgsPanelWidgetWrapper: public QgsPanelWidget
176 {
177  Q_OBJECT
178  public:
185  QgsPanelWidgetWrapper( QWidget* widget, QWidget* parent = nullptr );
186 
191  QWidget* widget() { return mWidget; }
192 
193  private:
194  QWidget* mWidget;
195 
196 };
197 
198 #endif // QGSPANELWIDGET_H
QWidget * widget()
Returns the internal widget that is wrapped in this panel.
bool dockMode()
Return the dock mode state.
bool autoDelete()
The the auto delete property on the widget.
Base class for any widget that can be shown as a inline panel.
void setAutoDelete(bool autoDelete)
The the auto delete property on the widget.
QString panelTitle()
The title of the panel.
void setPanelTitle(QString panelTitle)
Set the title of the panel when shown in the interface.
virtual void keyPressEvent(QKeyEvent *event)
Wrapper widget for existing widgets which can&#39;t have the inheritance tree changed, e.g dialogs.