Class: QgsPanelWidget

class qgis.gui.QgsPanelWidget

Bases: PyQt5.QtWidgets.QWidget

Base class for any widget that can be shown as a inline panel

QgsPanelWidget(parent: QWidget = None) Base class for any widget that can be shown as a inline panel

Parameters:

parent

Parent widget.

Methods

acceptPanel

Accept the panel.

actionEvent

applySizeConstraintsToStack

Returns True if the size constraints and hints for the panel widget should be applied to the parent QgsPanelWidgetStack which this panel is shown in.

autoDelete

The the auto delete property on the widget.

changeEvent

childEvent

closeEvent

connectChildPanel

Connect the given sub panel widgets showPanel signals to this current panels main showPanel event to bubble up to the user.

connectChildPanels

Connect the given sub panel widgets showPanel signals to this current panels main showPanel event to bubble up to the user.

connectNotify

contextMenuEvent

create

customEvent

destroy

disconnectNotify

dockMode

Returns the dock mode state.

dragEnterEvent

dragLeaveEvent

dragMoveEvent

dropEvent

enterEvent

event

findParentPanel

Traces through the parents of a widget to find if it is contained within a QgsPanelWidget widget.

focusInEvent

focusNextChild

focusNextPrevChild

focusOutEvent

focusPreviousChild

hideEvent

initPainter

inputMethodEvent

isSignalConnected

keyPressEvent

Overridden key press event to handle the esc event on the widget.

keyReleaseEvent

leaveEvent

menuButtonMenu

Returns the menu to use for the menu button for this panel, or None if no menu button is required.

menuButtonTooltip

Returns the (translated) tooltip text to use for the menu button for this panel.

metric

mouseDoubleClickEvent

mouseMoveEvent

mousePressEvent

mouseReleaseEvent

moveEvent

nativeEvent

openPanel

Open a panel or dialog depending on dock mode setting If dock mode is True this method will emit the showPanel signal for connected slots to handle the open event.

paintEvent

panelTitle

The title of the panel.

receivers

resizeEvent

sender

senderSignalIndex

setAutoDelete

The the auto delete property on the widget.

setDockMode

Set the widget in dock mode which tells the widget to emit panel widgets and not open dialogs

setPanelTitle

Set the title of the panel when shown in the interface.

sharedPainter

showEvent

tabletEvent

timerEvent

updateMicroFocus

wheelEvent

Signals

panelAccepted

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

showPanel

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

widgetChanged

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

acceptPanel(self)

Accept the panel. Causes panelAccepted to be emitted. Widgets are normally removed form the interface using the panel manager or the caller.

actionEvent(self, QActionEvent)
applySizeConstraintsToStack(self) bool

Returns True if the size constraints and hints for the panel widget should be applied to the parent QgsPanelWidgetStack which this panel is shown in.

The default behavior is to return False.

New in version 3.20.

Return type:

bool

autoDelete(self) bool

The the auto delete property on the widget. True by default. When auto delete is enabled when a panel is removed from the stack it will be deleted.

Return type:

bool

Returns:

The auto delete value for the widget.

changeEvent(self, QEvent)
childEvent(self, QChildEvent)
closeEvent(self, QCloseEvent)
connectChildPanel(self, panel: QgsPanelWidget)

Connect the given sub panel widgets showPanel signals to this current panels main showPanel event to bubble up to the user.

Use this method if you have children widgets that need to show a panel to the user.

Parameters:

panel (QgsPanelWidget) – The panel to connect.

connectChildPanels(self, panels: Iterable[QgsPanelWidget])

Connect the given sub panel widgets showPanel signals to this current panels main showPanel event to bubble up to the user.

Use this method if you have children widgets that need to show a panel to the user.

Parameters:

panels (Iterable[QgsPanelWidget]) – A list of panel widgets to connect.

connectNotify(self, QMetaMethod)
contextMenuEvent(self, QContextMenuEvent)
create(self, window: PyQt5.sip.voidptr = 0, initializeWindow: bool = True, destroyOldWindow: bool = True)
customEvent(self, QEvent)
destroy(self, destroyWindow: bool = True, destroySubWindows: bool = True)
disconnectNotify(self, QMetaMethod)
dockMode(self) bool

Returns the dock mode state.

Return type:

bool

Returns:

True if in dock mode. If in dock mode the widget will emit the showPanel signal to handle panel opening If False it will open dialogs when openPanel is called.

dragEnterEvent(self, QDragEnterEvent)
dragLeaveEvent(self, QDragLeaveEvent)
dragMoveEvent(self, QDragMoveEvent)
dropEvent(self, QDropEvent)
enterEvent(self, QEvent)
event(self, QEvent) bool
findParentPanel(widget: QWidget) QgsPanelWidget

Traces through the parents of a widget to find if it is contained within a QgsPanelWidget widget.

Parameters:

widget (QWidget) – widget which may be contained within a panel widget

Return type:

QgsPanelWidget

Returns:

parent panel widget if found, otherwise None

New in version 3.0.

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, event: QKeyEvent)

Overridden key press event to handle the esc event on the widget.

Parameters:

event (QKeyEvent) – The key event

keyReleaseEvent(self, QKeyEvent)
leaveEvent(self, QEvent)
menuButtonMenu(self) QMenu

Returns the menu to use for the menu button for this panel, or None if no menu button is required.

New in version 3.12.

Return type:

QMenu

menuButtonTooltip(self) str

Returns the (translated) tooltip text to use for the menu button for this panel.

This is only used when the panel returns a menuButtonMenu().

New in version 3.12.

Return type:

str

metric(self, QPaintDevice.PaintDeviceMetric) int
mouseDoubleClickEvent(self, QMouseEvent)
mouseMoveEvent(self, QMouseEvent)
mousePressEvent(self, QMouseEvent)
mouseReleaseEvent(self, QMouseEvent)
moveEvent(self, QMoveEvent)
nativeEvent(self, Union[QByteArray, bytes, bytearray], PyQt5.sip.voidptr) Tuple[bool, int]
openPanel(self, panel: QgsPanelWidget)

Open a panel or dialog depending on dock mode setting If dock mode is True this method will emit the showPanel signal for connected slots to handle the open event.

If dock mode is False this method will open a dialog and block the user.

Parameters:

panel (QgsPanelWidget) – The panel widget to open.

paintEvent(self, QPaintEvent)
panelAccepted

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Parameters:
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type:

PYQT_SIGNAL

panelTitle(self) str

The title of the panel.

Return type:

str

Returns:

The title pf the panel.

receivers(self, PYQT_SIGNAL) int
resizeEvent(self, QResizeEvent)
sender(self) QObject
senderSignalIndex(self) int
setAutoDelete(self, autoDelete: bool)

The the auto delete property on the widget. True by default. When auto delete is enabled when a panel is removed from the stack it will be deleted.

Parameters:

autoDelete (bool) – Enable or disable auto delete on the panel.

setDockMode(self, dockMode: bool)

Set the widget in dock mode which tells the widget to emit panel widgets and not open dialogs

Parameters:

dockMode (bool) – True to enable dock mode.

setPanelTitle(self, panelTitle: str)

Set the title of the panel when shown in the interface.

Parameters:

panelTitle (str) – The panel title.

sharedPainter(self) QPainter
showEvent(self, QShowEvent)
showPanel

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Parameters:
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type:

PYQT_SIGNAL

tabletEvent(self, QTabletEvent)
timerEvent(self, QTimerEvent)
updateMicroFocus(self)
wheelEvent(self, QWheelEvent)
widgetChanged

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Parameters:
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type:

PYQT_SIGNAL