QGIS API Documentation  3.20.0-Odense (decaadbb31)
Public Slots | Public Member Functions | Protected Member Functions | List of all members
QgsPanelWidgetStack Class Reference

A stack widget to manage panels in the interface. More...

#include <qgspanelwidgetstack.h>

Inheritance diagram for QgsPanelWidgetStack:
Inheritance graph
[legend]

Public Slots

void acceptAllPanels ()
 Accepts all panel widgets open in the stack in turn until until only the mainPanel() remains. More...
 
void acceptCurrentPanel ()
 Accept the current active widget in the stack. More...
 
void closePanel (QgsPanelWidget *panel)
 Closes the panel in the widget. More...
 
void showPanel (QgsPanelWidget *panel)
 Show a panel in the stack widget. More...
 

Public Member Functions

 QgsPanelWidgetStack (QWidget *parent=nullptr)
 A stack widget to manage panels in the interface. More...
 
void clear ()
 Clear the stack of all widgets. More...
 
QgsPanelWidgetcurrentPanel ()
 Returns the panel currently shown in the stack. More...
 
QgsPanelWidgetmainPanel ()
 The main panel widget that is set in the stack. More...
 
QSize minimumSizeHint () const override
 
void setMainPanel (QgsPanelWidget *panel SIP_TRANSFER)
 Sets the main panel widget for the stack and selects it for the user. More...
 
QSize sizeHint () const override
 
QgsPanelWidgettakeMainPanel () SIP_TRANSFERBACK
 Removes the main panel widget from the stack and transfers ownsership to the caller. More...
 

Protected Member Functions

void keyPressEvent (QKeyEvent *e) override
 
void mouseReleaseEvent (QMouseEvent *e) override
 

Detailed Description

A stack widget to manage panels in the interface.

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.

Definition at line 35 of file qgspanelwidgetstack.h.

Constructor & Destructor Documentation

◆ QgsPanelWidgetStack()

QgsPanelWidgetStack::QgsPanelWidgetStack ( QWidget *  parent = nullptr)

A stack widget to manage panels in the interface.

Handles the open and close events for added panels.

Parameters
parent

Definition at line 26 of file qgspanelwidgetstack.cpp.

Member Function Documentation

◆ acceptAllPanels

void QgsPanelWidgetStack::acceptAllPanels ( )
slot

Accepts all panel widgets open in the stack in turn until until only the mainPanel() remains.

See also
acceptCurrentPanel();
Since
QGIS 3.0

Definition at line 124 of file qgspanelwidgetstack.cpp.

◆ acceptCurrentPanel

void QgsPanelWidgetStack::acceptCurrentPanel ( )
slot

Accept the current active widget in the stack.

Calls the panelAccepeted signal on the active widget.

See also
acceptAllPanels()

Definition at line 114 of file qgspanelwidgetstack.cpp.

◆ clear()

void QgsPanelWidgetStack::clear ( )

Clear the stack of all widgets.

Unless the panels autoDelete is set to false the widget will be deleted.

Definition at line 63 of file qgspanelwidgetstack.cpp.

◆ closePanel

void QgsPanelWidgetStack::closePanel ( QgsPanelWidget panel)
slot

Closes the panel in the widget.

Will also delete the widget. This slot is normally auto connected to panelAccepted when a panel is shown.

Parameters
panelThe panel to close.

Definition at line 157 of file qgspanelwidgetstack.cpp.

◆ currentPanel()

QgsPanelWidget * QgsPanelWidgetStack::currentPanel ( )

Returns the panel currently shown in the stack.

Since
QGIS 3.0

Definition at line 88 of file qgspanelwidgetstack.cpp.

◆ keyPressEvent()

void QgsPanelWidgetStack::keyPressEvent ( QKeyEvent *  e)
overrideprotected

Definition at line 188 of file qgspanelwidgetstack.cpp.

◆ mainPanel()

QgsPanelWidget * QgsPanelWidgetStack::mainPanel ( )

The main panel widget that is set in the stack.

The main widget can not be closed and doesn't display a back button.

Returns
The main QgsPanelWidget that is active in the stack.
See also
setMainPanel()

Definition at line 48 of file qgspanelwidgetstack.cpp.

◆ minimumSizeHint()

QSize QgsPanelWidgetStack::minimumSizeHint ( ) const
override

Definition at line 103 of file qgspanelwidgetstack.cpp.

◆ mouseReleaseEvent()

void QgsPanelWidgetStack::mouseReleaseEvent ( QMouseEvent *  e)
overrideprotected

Definition at line 180 of file qgspanelwidgetstack.cpp.

◆ setMainPanel()

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.

Note
a stack can have only one main panel. Any existing main panel should be removed by first calling takeMainPanel().
See also
mainPanel()
takeMainPanel()

Definition at line 37 of file qgspanelwidgetstack.cpp.

◆ showPanel

void QgsPanelWidgetStack::showPanel ( QgsPanelWidget panel)
slot

Show a panel in the stack widget.

Will connect to the panels showPanel event to handle nested panels. Auto switches the the given panel for the user.

Parameters
panelThe panel to show.

Definition at line 141 of file qgspanelwidgetstack.cpp.

◆ sizeHint()

QSize QgsPanelWidgetStack::sizeHint ( ) const
override

Definition at line 93 of file qgspanelwidgetstack.cpp.

◆ takeMainPanel()

QgsPanelWidget * QgsPanelWidgetStack::takeMainPanel ( )

Removes the main panel widget from the stack and transfers ownsership to the caller.

Returns
The main widget that is set in the stack.
Note
Calling this will clear out any current stacked panels by accepting each panel in turn.
See also
mainPanel()
setMainPanel()

Definition at line 53 of file qgspanelwidgetstack.cpp.


The documentation for this class was generated from the following files: