Class: QgsStyleItemsListWidget

A reusable widget for showing a filtered list of entities from a QgsStyle database.

Added in version 3.10.

Class Hierarchy

Inheritance diagram of qgis.gui.QgsStyleItemsListWidget

Base classes

QWidget

QObject

QPaintDevice

Methods

currentEntityType

Returns the type of the item currently selected in the widget.

currentItemName

Returns the name of the item currently selected in the widget.

currentTagFilter

Returns the current tag filter set for the widget, if any is set.

setEntityType

Sets the type of style entity to show in the widget.

setLayerType

Sets the layer type to show in the widget.

setStyle

Sets the style database associated with the widget.

setSymbolType

Sets the type of symbols to show in the widget.

Signals

saveEntity

Emitted when the user has opted to save a new entity to the style database, by clicking the "Save" button in the widget.

selectionChanged

Emitted when the selected item is changed in the widget.

selectionChangedWithStylePath

Emitted when the selected item is changed in the widget.

class qgis.gui.QgsStyleItemsListWidget[source]

Bases: QWidget

__init__(parent: QWidget | None)

Constructor for QgsStyleItemsListWidget, with the specified parent widget.

Parameters:

parent (Optional[QWidget])

currentEntityType(self) QgsStyle.StyleEntity[source]

Returns the type of the item currently selected in the widget.

Return type:

QgsStyle.StyleEntity

currentItemName(self) str[source]

Returns the name of the item currently selected in the widget.

Return type:

str

currentTagFilter(self) str[source]

Returns the current tag filter set for the widget, if any is set.

Return type:

str

signal saveEntity[source]

Emitted when the user has opted to save a new entity to the style database, by clicking the “Save” button in the widget.

It is the caller’s responsibility to handle this in an appropriate manner given the context of the widget.

signal selectionChanged(name: str, type: QgsStyle.StyleEntity)[source]

Emitted when the selected item is changed in the widget.

Parameters:
signal selectionChangedWithStylePath(name: str, type: QgsStyle.StyleEntity, stylePath: str)[source]

Emitted when the selected item is changed in the widget.

Parameters:
  • name (str) – Newly selected item name

  • type (QgsStyle.StyleEntity) – Newly selected item type

  • stylePath (str) – file path to associated style database

Added in version 3.26.

setEntityType(self, type: QgsStyle.StyleEntity)[source]

Sets the type of style entity to show in the widget.

See also

setSymbolType()

Parameters:

type (QgsStyle.StyleEntity)

setLayerType(self, type: Qgis.GeometryType)[source]

Sets the layer type to show in the widget. Set type to Qgis.GeometryType.Unknown if no layer type filter is desired.

This setting only applies to label settings and 3d style entities.

Parameters:

type (Qgis.GeometryType)

setStyle(self, style: QgsStyle | None)[source]

Sets the style database associated with the widget.

Ownership of style is not transferred, and the caller is responsible for ensuring that it exists for the lifetime of the widget.

Parameters:

style (Optional[QgsStyle])

setSymbolType(self, type: Qgis.SymbolType)[source]

Sets the type of symbols to show in the widget.

See also

setEntityType()

Parameters:

type (Qgis.SymbolType)