QgsPanelWidgetStack class
A stack widget to manage panels in the interface.
Contents
Handles the open and close events for added panels. Any widgets that want to have a non blocking panel based interface should use this class to manage the panels.
Constructors, destructors, conversion operators
- QgsPanelWidgetStack(QWidget* parent = nullptr)
- A stack widget to manage panels in the interface.
Public functions
- void clear()
- Clear the stack of all widgets.
- auto currentPanel() -> QgsPanelWidget*
- Returns the panel currently shown in the stack.
- auto mainPanel() -> QgsPanelWidget*
- The main panel widget that is set in the stack.
- void setMainPanel(QgsPanelWidget*panel SIP_TRANSFER)
- Sets the main panel widget for the stack and selects it for the user.
- auto takeMainPanel() SIP_TRANSFERBACK -> QgsPanelWidget*
- Removes the main panel widget from the stack and transfers ownsership to the caller.
Public slots
- void acceptAllPanels()
- Accepts all panel widgets open in the stack in turn until until only the mainPanel() remains.
- void acceptCurrentPanel()
- Accept the current active widget in the stack.
- void closePanel(QgsPanelWidget* panel)
- Closes the panel in the widget.
- void showPanel(QgsPanelWidget* panel)
- Show a panel in the stack widget.
Function documentation
QgsPanelWidgetStack:: QgsPanelWidgetStack(QWidget* parent = nullptr)
A stack widget to manage panels in the interface.
| Parameters | |
|---|---|
| parent | |
Handles the open and close events for added panels.
void QgsPanelWidgetStack:: clear()
Clear the stack of all widgets.
Unless the panels autoDelete is set to false the widget will be deleted.
QgsPanelWidget* QgsPanelWidgetStack:: currentPanel()
Returns the panel currently shown in the stack.
QgsPanelWidget* QgsPanelWidgetStack:: mainPanel()
The main panel widget that is set in the stack.
| Returns | The main QgsPanelWidget that is active in the stack. |
|---|
The main widget can not be closed and doesn't display a back button.
void QgsPanelWidgetStack:: setMainPanel(QgsPanelWidget*panel SIP_TRANSFER)
Sets the main panel widget for the stack and selects it for the user.
The main widget cannot be closed and only the showPanel signal is attached to handle children widget opening panels.
Ownership of panel is transferred to the stack.
QgsPanelWidget* QgsPanelWidgetStack:: takeMainPanel() SIP_TRANSFERBACK
Removes the main panel widget from the stack and transfers ownsership to the caller.
| Returns | The main widget that is set in the stack. |
|---|
void QgsPanelWidgetStack:: acceptAllPanels() public slot
Accepts all panel widgets open in the stack in turn until until only the mainPanel() remains.
void QgsPanelWidgetStack:: acceptCurrentPanel() public slot
Accept the current active widget in the stack.
Calls the panelAccepeted signal on the active widget.
void QgsPanelWidgetStack:: closePanel(QgsPanelWidget* panel) public slot
Closes the panel in the widget.
| Parameters | |
|---|---|
| panel | The panel to close. |
Will also delete the widget. This slot is normally auto connected to panelAccepted when a panel is shown.
void QgsPanelWidgetStack:: showPanel(QgsPanelWidget* panel) public slot
Show a panel in the stack widget.
| Parameters | |
|---|---|
| panel | The panel to show. |
Will connect to the panels showPanel event to handle nested panels. Auto switches the the given panel for the user.