Class: QgsCombinedStyleModel

A model which contains entities from multiple QgsStyle databases.

Note

Only available in builds based on Qt 5.13 or later

Added in version 3.26.

Class Hierarchy

Inheritance diagram of qgis.core.QgsCombinedStyleModel

Base classes

QConcatenateTablesProxyModel

QAbstractItemModel

QObject

Methods

addDefaultStyle

Adds the default style (QgsStyle.defaultStyle()) to the model.

addDesiredIconSize

Adds an additional icon size to generate for Qt.DecorationRole data.

addStyle

Adds a style to the model.

addTargetScreenProperties

Adds additional target screen properties to use when generating icons for Qt.DecorationRole data.

removeStyle

Removes a style from the model.

styles

Returns a list of all styles shown in the model.

class qgis.core.QgsCombinedStyleModel[source]

Bases: QConcatenateTablesProxyModel

__init__(parent: QObject | None = None)

Constructor for QgsCombinedStyleModel with the specified parent object.

Parameters:

parent (Optional[QObject] = None)

addDefaultStyle(self)[source]

Adds the default style (QgsStyle.defaultStyle()) to the model.

See also

addStyle()

addDesiredIconSize(self, size: QSize)[source]

Adds an additional icon size to generate for Qt.DecorationRole data.

This allows style icons to be generated at an icon size which corresponds exactly to the view’s icon size in which this model is used.

Parameters:

size (QSize)

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

Adds a style to the model.

Ownership of style is not transferred.

See also

styles()

See also

removeStyle()

Parameters:

style (Optional[QgsStyle])

addTargetScreenProperties(self, properties: QgsScreenProperties)[source]

Adds additional target screen properties to use when generating icons for Qt.DecorationRole data.

This allows style icons to be generated at an icon device pixel ratio and DPI which corresponds exactly to the view’s screen properties in which this model is used.

Added in version 3.32.

Parameters:

properties (QgsScreenProperties)

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

Removes a style from the model.

See also

addStyle()

Parameters:

style (Optional[QgsStyle])

styles(self) List[QgsStyle]

Returns a list of all styles shown in the model.

See also

addStyle()

Return type:

List[QgsStyle]