QGIS API Documentation  3.2.0-Bonn (bc43194)
qgspanelwidgetstack.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgspanelwidgetstack.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 QGSPANELWIDGETSTACK_H
16 #define QGSPANELWIDGETSTACK_H
17 
18 #include <QWidget>
19 #include <QKeyEvent>
20 #include <QStackedWidget>
21 #include <QStack>
22 
23 #include "ui_qgsrenderercontainerbase.h"
24 #include "qgis_gui.h"
25 
26 class QgsPanelWidget;
27 
35 class GUI_EXPORT QgsPanelWidgetStack : public QWidget, private Ui::QgsRendererWidgetContainerBase
36 {
37  Q_OBJECT
38  public:
39 
45  QgsPanelWidgetStack( QWidget *parent = nullptr );
46 
57  void setMainPanel( QgsPanelWidget *panel );
58 
65  QgsPanelWidget *mainPanel();
66 
76  QgsPanelWidget *takeMainPanel();
77 
82  void clear();
83 
88  QgsPanelWidget *currentPanel();
89 
90  public slots:
91 
98  void acceptCurrentPanel();
99 
106  void acceptAllPanels();
107 
113  void showPanel( QgsPanelWidget *panel );
114 
120  void closePanel( QgsPanelWidget *panel );
121 
122  protected:
123 
124  void mouseReleaseEvent( QMouseEvent *e ) override;
125  void keyPressEvent( QKeyEvent *e ) override;
126 
127  private:
128  void updateBreadcrumb();
129  QStack<QString> mTitles;
130 };
131 
132 
133 #endif // QGSPANELWIDGETSTACK_H
A stack widget to manage panels in the interface.
Base class for any widget that can be shown as a inline panel.