Class: QgsPanelWidgetStack¶
- class qgis.gui.QgsPanelWidgetStack(parent: QWidget = None)¶
Bases:
PyQt5.QtWidgets.QWidget
A stack widget to manage panels in the interface. Handles the open and close events for added panels.
- Parameters
parent –
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.
Methods
Accepts all panel widgets open in the stack in turn until until only the
mainPanel()
remains.Accept the current active widget in the stack.
Clear the stack of all widgets.
Closes the panel in the widget.
Returns the panel currently shown in the stack.
- param e
The main panel widget that is set in the stack.
- param e
Sets the main
panel
widget for the stack and selects it for the user.Show a panel in the stack widget.
Removes the main panel widget from the stack and transfers ownsership to the caller.
- acceptAllPanels(self)¶
Accepts all panel widgets open in the stack in turn until until only the
mainPanel()
remains.See also
New in version 3.0.
- acceptCurrentPanel(self)¶
Accept the current active widget in the stack.
Calls the panelAccepeted signal on the active widget.
See also
- 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
- 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
- Returns
The main
QgsPanelWidget
that is active in the stack.
See also
- metric(self, QPaintDevice.PaintDeviceMetric) int ¶
- 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
See also
- Parameters
panel (QgsPanelWidget) –
- 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.
- tabletEvent(self, QTabletEvent)¶
- takeMainPanel(self) QgsPanelWidget ¶
Removes the main panel widget from the stack and transfers ownsership to the caller.
- Return type
- 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
See also
- timerEvent(self, QTimerEvent)¶
- updateMicroFocus(self)¶
- wheelEvent(self, QWheelEvent)¶