QGIS API Documentation 3.99.0-Master (26c88405ac0)
Loading...
Searching...
No Matches
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 "ui_qgsrenderercontainerbase.h"
19
20#include "qgis_gui.h"
21
22#include <QKeyEvent>
23#include <QStack>
24#include <QStackedWidget>
25#include <QWidget>
26
27class QgsPanelWidget;
28
38class GUI_EXPORT QgsPanelWidgetStack : public QWidget, private Ui::QgsRendererWidgetContainerBase
39{
40 Q_OBJECT
41 public:
42
48 QgsPanelWidgetStack( QWidget *parent = nullptr );
49
65
73
84
89 void clear();
90
95
96 QSize sizeHint() const override;
97 QSize minimumSizeHint() const override;
98
99 public slots:
100
107 void acceptCurrentPanel();
108
114 void acceptAllPanels();
115
121 void showPanel( QgsPanelWidget *panel );
122
128 void closePanel( QgsPanelWidget *panel );
129
130 protected:
131 void mouseReleaseEvent( QMouseEvent *e ) override;
132 void keyPressEvent( QKeyEvent *e ) override;
133
134 private:
135 void updateBreadcrumb();
136 void updateMenuButton();
137 QStack<QString> mTitles;
138};
139
140
141#endif // QGSPANELWIDGETSTACK_H
QgsPanelWidget * currentPanel()
Returns the panel currently shown in the stack.
void closePanel(QgsPanelWidget *panel)
Closes the panel in the widget.
QSize sizeHint() const override
void acceptAllPanels()
Accepts all panel widgets open in the stack in turn until only the mainPanel() remains.
QgsPanelWidgetStack(QWidget *parent=nullptr)
A stack widget to manage panels in the interface.
QgsPanelWidget * mainPanel()
The main panel widget that is set in the stack.
QSize minimumSizeHint() const override
void showPanel(QgsPanelWidget *panel)
Show a panel in the stack widget.
void acceptCurrentPanel()
Accept the current active widget in the stack.
void setMainPanel(QgsPanelWidget *panel SIP_TRANSFER)
Sets the main panel widget for the stack and selects it for the user.
QgsPanelWidget * takeMainPanel() SIP_TRANSFERBACK
Removes the main panel widget from the stack and transfers ownsership to the caller.
void clear()
Clear the stack of all widgets.
void mouseReleaseEvent(QMouseEvent *e) override
void keyPressEvent(QKeyEvent *e) override
Base class for any widget that can be shown as an inline panel.
#define SIP_TRANSFER
Definition qgis_sip.h:36
#define SIP_TRANSFERBACK
Definition qgis_sip.h:48