Class: QgsCombinedStyleModel

class qgis.core.QgsCombinedStyleModel

Bases: PyQt5.QtCore.QConcatenateTablesProxyModel

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.

QgsCombinedStyleModel(parent: QObject = None) Constructor for QgsCombinedStyleModel with the specified parent object.

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.

beginInsertColumns

beginInsertRows

beginMoveColumns

beginMoveRows

beginRemoveColumns

beginRemoveRows

beginResetModel

changePersistentIndex

changePersistentIndexList

childEvent

connectNotify

createIndex

customEvent

decodeData

disconnectNotify

encodeData

endInsertColumns

endInsertRows

endMoveColumns

endMoveRows

endRemoveColumns

endRemoveRows

endResetModel

headerData

param section:

isSignalConnected

persistentIndexList

receivers

removeStyle

Removes a style from the model.

resetInternalData

sender

senderSignalIndex

styles

Returns a list of all styles shown in the model.

timerEvent

addDefaultStyle(self)

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

See also

addStyle()

addDesiredIconSize(self, size: QSize)

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)

Adds a style to the model.

Ownership of style is not transferred.

See also

styles()

See also

removeStyle()

Parameters:

style (QgsStyle)

addTargetScreenProperties(self, properties: QgsScreenProperties)

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)

beginInsertColumns(self, QModelIndex, int, int)
beginInsertRows(self, QModelIndex, int, int)
beginMoveColumns(self, QModelIndex, int, int, QModelIndex, int) bool
beginMoveRows(self, QModelIndex, int, int, QModelIndex, int) bool
beginRemoveColumns(self, QModelIndex, int, int)
beginRemoveRows(self, QModelIndex, int, int)
beginResetModel(self)
changePersistentIndex(self, QModelIndex, QModelIndex)
changePersistentIndexList(self, Iterable[QModelIndex], Iterable[QModelIndex])
childEvent(self, QChildEvent)
connectNotify(self, QMetaMethod)
createIndex(self, int, int, object: object = 0) QModelIndex
customEvent(self, QEvent)
decodeData(self, int, int, QModelIndex, QDataStream) bool
disconnectNotify(self, QMetaMethod)
encodeData(self, Iterable[QModelIndex], QDataStream)
endInsertColumns(self)
endInsertRows(self)
endMoveColumns(self)
endMoveRows(self)
endRemoveColumns(self)
endRemoveRows(self)
endResetModel(self)
headerData(self, section: int, orientation: Qt.Orientation, role: int = Qt.DisplayRole) Any
Parameters:
  • section (int)

  • orientation (Qt.Orientation)

  • role (int = Qt.DisplayRole)

Return type:

Any

isSignalConnected(self, QMetaMethod) bool
persistentIndexList(self) List[QModelIndex]
receivers(self, PYQT_SIGNAL) int
removeStyle(self, style: QgsStyle)

Removes a style from the model.

See also

addStyle()

Parameters:

style (QgsStyle)

resetInternalData(self)
sender(self) QObject
senderSignalIndex(self) int
styles(self) List[QgsStyle]

Returns a list of all styles shown in the model.

See also

addStyle()

Return type:

List[QgsStyle]

timerEvent(self, QTimerEvent)