Class: QgsPanelWidget

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

Class Hierarchy

Inheritance diagram of qgis.gui.QgsPanelWidget

Base classes

QWidget

QObject

QPaintDevice

Subclasses

QgsRendererWidget

Base class for renderer settings widgets.

QgsAggregateMappingWidget

A widget which creates a mapping for defining sets of aggregates of fields from a QgsFields object.

QgsAnnotationItemBaseWidget

A base class for property widgets for annotation items.

QgsNumericFormatWidget

Base class for widgets which allow control over the properties of QgsNumericFormat subclasses.

QgsBrowserWidget

A widget showing a browser tree view along with toolbar and toggleable properties pane.

QgsCalloutPanelWidget

A panel widget for configuration of callouts.

QgsCodeEditorWidget

A widget which wraps a QgsCodeEditor in additional functionality.

QgsColorBrewerColorRampWidget

A widget which allows users to modify the properties of a QgsColorBrewerColorRamp.

QgsColorRampLegendNodeWidget

A widget for properties relating to a QgsColorRampLegendNode (QgsColorRampLegendNodeSettings).

QgsCompoundColorWidget

A custom QGIS widget for selecting a color, including options for selecting colors via hue wheel, color swatches, and a color sampler.

QgsCrsSelectionWidget

A generic widget allowing users to pick a Coordinate Reference System (or define their own).

QgsDashSpaceWidget

A widget for entering a custom dash space pattern for lines.

QgsDataDefinedSizeLegendWidget

Widget for configuration of appearance of legend for marker symbols with data-defined size.

QgsDataSourceSelectWidget

Embeds the browser view to select an existing data source.

QgsDevToolWidget

A panel widget that can be shown in the developer tools panel.

QgsEditConditionalFormatRuleWidget

A widget for customizing an individual conditional formatting rule.

QgsEffectStackCompactWidget

A small widget consisting of a checkbox for enabling/disabling an effect stack and a button for opening an effect stack customization dialog.

QgsEffectStackPropertiesWidget

A widget for modifying the properties of a QgsEffectStack, including adding and reordering effects within the stack.

QgsFieldConditionalFormatWidget

A widget for customizing conditional formatting options.

QgsFieldMappingWidget

Creates a mapping from one set of QgsFields to another, for each set of “destination” fields an expression defines how to obtain the values of the “destination” fields.

QgsHistoryWidget

A widget showing entries from a QgsHistoryProviderRegistry.

QgsLabelSettingsWidgetBase

Base class for widgets which allow customization of label engine properties, such as label placement settings.

QgsLabelingEngineRuleWidget

Base class for widgets which allow control over the properties of QgsAbstractLabelingEngineRule subclasses.

QgsLabelingEngineRulesWidget

A widget which allows configuration of a list of labeling engine rules.

QgsLayerPropertiesWidget

A widget which allows configuration of the properties of a single QgsSymbolLayer.

QgsLayoutItemBaseWidget

A base class for property widgets for layout items.

QgsLegendPatchShapeWidget

Widget for configuring a custom legend patch shape.

QgsLimitedRandomColorRampWidget

A widget which allows users to modify the properties of a QgsLimitedRandomColorRamp.

QgsMapLayerConfigWidget

A panel widget that can be shown in the map style dock.

QgsMapUnitScaleWidget

A widget which allows the user to choose the minimum and maximum scale of an object in map units and millimeters.

QgsNewDatabaseTableNameWidget

A widget which embeds the browser view to select a DB schema and a new table name.

QgsNumericFormatSelectorWidget

A widget which allows choice of numeric formats and the properties of them.

QgsPanelWidgetWrapper

Wrapper widget for existing widgets which can’t have the inheritance tree changed, e.g dialogs.

QgsPointCloudRendererWidget

Base class for point cloud 2D renderer settings widgets.

QgsPresetColorRampWidget

A widget which allows users to modify the properties of a QgsPresetSchemeColorRamp.

QgsProcessingHistoryWidget

A widget for showing Processing algorithm execution history.

QgsProcessingMultipleSelectionPanelWidget

A panel widget for selection of multiple options from a fixed list of options.

QgsProcessingParametersWidget

A widget which allows users to select the value for the parameters for an algorithm.

QgsPropertyAssistantWidget

Shows a user-friendly assistant guiding users through the creation of QgsProperty overrides.

QgsRasterAttributeTableWidget

The QgsRasterAttributeTableWidget class provides an attribute table for rasters and methods to edit the table.

QgsRendererRulePropsWidget

A widget for editing the details of a rule based renderer rule.

QgsSubstitutionListWidget

A widget which allows users to specify a list of substitutions to apply to a string, with options for exporting and importing substitution lists.

QgsSymbolAnimationSettingsWidget

A widget for customising animation settings for a symbol.

QgsSymbolBufferSettingsWidget

A widget for customising buffer settings for a symbol.

QgsSymbolLevelsWidget

A widget which allows the user to modify the rendering order of symbol layers.

QgsSymbolSelectorWidget

Symbol selector widget that can be used to select and build a symbol.

QgsTabPositionWidget

A widget for configuring QgsTextFormat tab positions.

QgsTemporalControllerWidget

A widget for controlling playback properties of a QgsTemporalController.

QgsTiledSceneRendererWidget

Base class for tiled scene 2D renderer settings widgets.

Methods

acceptPanel

Accept the panel.

autoDelete

The the auto delete property on the widget.

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.

dockMode

Returns the dock mode state.

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.

panelTitle

The title of the panel.

setAutoDelete

The the auto delete property on the widget.

setPanelTitle

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

Virtual Methods

In PyQGIS, only methods marked as virtual can be safely overridden in a Python subclass of QgsPanelWidget. See the FAQ for more details.

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.

keyPressEvent

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

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.

setDockMode

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

Static Methods

findParentPanel

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

Signals

panelAccepted

Emitted when the panel is accepted by the user.

showPanel

Emit when you require a panel to be show in the interface.

widgetChanged

Emitted when the widget state changes.

class qgis.gui.QgsPanelWidget[source]

Bases: QWidget

__init__(parent: QWidget | None = None)

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

Parameters:

parent (Optional[QWidget] = None) – Parent widget.

acceptPanel(self)[source]

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

virtual applySizeConstraintsToStack(self) bool[source]

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.

Added in version 3.20.

Return type:

bool

autoDelete(self) bool[source]

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.

connectChildPanel(self, panel: QgsPanelWidget | None)[source]

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 (Optional[QgsPanelWidget]) – The panel to connect.

connectChildPanels(self, panels: Iterable[QgsPanelWidget])[source]

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.

dockMode(self) bool[source]

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.

static findParentPanel(widget: QWidget | None) QgsPanelWidget | None[source]

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

Parameters:

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

Return type:

Optional[QgsPanelWidget]

Returns:

parent panel widget if found, otherwise None

virtual keyPressEvent(self, event: QKeyEvent | None)[source]

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

Parameters:

event (Optional[QKeyEvent]) – The key event

virtual menuButtonMenu(self) QMenu | None[source]

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

Added in version 3.12.

Return type:

Optional[QMenu]

virtual menuButtonTooltip(self) str[source]

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

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

Added in version 3.12.

Return type:

str

openPanel(self, panel: QgsPanelWidget | None)[source]

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 (Optional[QgsPanelWidget]) – The panel widget to open.

signal panelAccepted(panel: QgsPanelWidget)[source]

Emitted when the panel is accepted by the user.

Parameters:

panel (QgsPanelWidget) – The panel widget that was accepted.

Note

This argument is normally raised with emit panelAccepted(this) so that callers can retrieve the widget easier in calling code.

Note

this is emitted only when this panel is accepted, and is not emitted for child panels. For example, if this panel opens a second stacked panel, then this panel will not emit panelAccepted when the second panel is accepted.

panelTitle(self) str[source]

The title of the panel.

Return type:

str

Returns:

The title pf the panel.

setAutoDelete(self, autoDelete: bool)[source]

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.

virtual setDockMode(self, dockMode: bool)[source]

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 | None)[source]

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

Parameters:

panelTitle (Optional[str]) – The panel title.

signal showPanel(panel: QgsPanelWidget)[source]

Emit when you require a panel to be show in the interface.

Parameters:

panel (QgsPanelWidget) – The panel widget to show.

Note

If you are connected to this signal you should also connect given panels showPanel signal as they can be nested.

signal widgetChanged[source]

Emitted when the widget state changes. Connect to this to pull any changes off the widget when needed. As panels are non blocking “dialogs” you should listen to this signal to give the user feedback when something changes.