Class: QgsPanelWidgetStack

class qgis.gui.QgsPanelWidgetStack

Bases: PyQt5.QtWidgets.QWidget

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.

QgsPanelWidgetStack(parent: QWidget = None) A stack widget to manage panels in the interface. Handles the open and close events for added panels.

Parameters

parent

Methods

acceptAllPanels

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

acceptCurrentPanel

Accept the current active widget in the stack.

actionEvent

changeEvent

childEvent

clear

Clear the stack of all widgets.

closeEvent

closePanel

Closes the panel in the widget.

connectNotify

contextMenuEvent

create

currentPanel

Returns the panel currently shown in the stack.

customEvent

destroy

disconnectNotify

dragEnterEvent

dragLeaveEvent

dragMoveEvent

dropEvent

enterEvent

event

focusInEvent

focusNextChild

focusNextPrevChild

focusOutEvent

focusPreviousChild

hideEvent

initPainter

inputMethodEvent

isSignalConnected

keyPressEvent

param e

keyReleaseEvent

leaveEvent

mainPanel

The main panel widget that is set in the stack.

metric

minimumSizeHint

rtype

QSize

mouseDoubleClickEvent

mouseMoveEvent

mousePressEvent

mouseReleaseEvent

param e

moveEvent

nativeEvent

paintEvent

receivers

resizeEvent

sender

senderSignalIndex

setMainPanel

Sets the main panel widget for the stack and selects it for the user.

sharedPainter

showEvent

showPanel

Show a panel in the stack widget.

sizeHint

rtype

QSize

tabletEvent

takeMainPanel

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

timerEvent

updateMicroFocus

wheelEvent

acceptAllPanels(self)

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

New in version 3.0.

acceptCurrentPanel(self)

Accept the current active widget in the stack.

Calls the panelAccepeted signal on the active widget.

actionEvent(self, QActionEvent)
changeEvent(self, QEvent)
childEvent(self, QChildEvent)
clear(self)

Clear the stack of all widgets. Unless the panels autoDelete is set to False the widget will be deleted.

closeEvent(self, QCloseEvent)
closePanel(self, panel: QgsPanelWidget)

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

panel (QgsPanelWidget) – The panel to close.

connectNotify(self, QMetaMethod)
contextMenuEvent(self, QContextMenuEvent)
create(self, window: sip.voidptr = 0, initializeWindow: bool = True, destroyOldWindow: bool = True)
currentPanel(self)QgsPanelWidget

Returns the panel currently shown in the stack.

New in version 3.0.

Return type

QgsPanelWidget

customEvent(self, QEvent)
destroy(self, destroyWindow: bool = True, destroySubWindows: bool = True)
disconnectNotify(self, QMetaMethod)
dragEnterEvent(self, QDragEnterEvent)
dragLeaveEvent(self, QDragLeaveEvent)
dragMoveEvent(self, QDragMoveEvent)
dropEvent(self, QDropEvent)
enterEvent(self, QEvent)
event(self, QEvent)bool
focusInEvent(self, QFocusEvent)
focusNextChild(self)bool
focusNextPrevChild(self, bool)bool
focusOutEvent(self, QFocusEvent)
focusPreviousChild(self)bool
hideEvent(self, QHideEvent)
initPainter(self, QPainter)
inputMethodEvent(self, QInputMethodEvent)
isSignalConnected(self, QMetaMethod)bool
keyPressEvent(self, e: QKeyEvent)
Parameters

e (QKeyEvent) –

keyReleaseEvent(self, QKeyEvent)
leaveEvent(self, QEvent)
mainPanel(self)QgsPanelWidget

The main panel widget that is set in the stack. The main widget can not be closed and doesn’t display a back button.

Return type

QgsPanelWidget

Returns

The main QgsPanelWidget that is active in the stack.

See also

setMainPanel()

metric(self, QPaintDevice.PaintDeviceMetric)int
minimumSizeHint(self)QSize
Return type

QSize

mouseDoubleClickEvent(self, QMouseEvent)
mouseMoveEvent(self, QMouseEvent)
mousePressEvent(self, QMouseEvent)
mouseReleaseEvent(self, e: QMouseEvent)
Parameters

e (QMouseEvent) –

moveEvent(self, QMoveEvent)
nativeEvent(self, Union[QByteArray, bytes, bytearray], sip.voidptr)Tuple[bool, int]
paintEvent(self, QPaintEvent)
receivers(self, PYQT_SIGNAL)int
resizeEvent(self, QResizeEvent)
sender(self)QObject
senderSignalIndex(self)int
setMainPanel(self, panel: QgsPanelWidget)

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()

See also

takeMainPanel()

Parameters

panel (QgsPanelWidget) –

sharedPainter(self)QPainter
showEvent(self, QShowEvent)
showPanel(self, panel: QgsPanelWidget)

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

panel (QgsPanelWidget) – The panel to show.

sizeHint(self)QSize
Return type

QSize

tabletEvent(self, QTabletEvent)
takeMainPanel(self)QgsPanelWidget

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

Return type

QgsPanelWidget

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()

See also

setMainPanel()

timerEvent(self, QTimerEvent)
updateMicroFocus(self)
wheelEvent(self, QWheelEvent)