QGIS API Documentation  3.6.0-Noosa (5873452)
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 
61  void setMainPanel( QgsPanelWidget *panel SIP_TRANSFER );
62 
69  QgsPanelWidget *mainPanel();
70 
80  QgsPanelWidget *takeMainPanel() SIP_TRANSFERBACK;
81 
86  void clear();
87 
92  QgsPanelWidget *currentPanel();
93 
94  public slots:
95 
102  void acceptCurrentPanel();
103 
110  void acceptAllPanels();
111 
117  void showPanel( QgsPanelWidget *panel );
118 
124  void closePanel( QgsPanelWidget *panel );
125 
126  protected:
127 
128  void mouseReleaseEvent( QMouseEvent *e ) override;
129  void keyPressEvent( QKeyEvent *e ) override;
130 
131  private:
132  void updateBreadcrumb();
133  QStack<QString> mTitles;
134 };
135 
136 
137 #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.
#define SIP_TRANSFERBACK
Definition: qgis_sip.h:41
#define SIP_TRANSFER
Definition: qgis_sip.h:36