Class: QgsStyleModel¶
- class qgis.core.QgsStyleModel¶
Bases:
PyQt5.QtCore.QAbstractItemModel
A QAbstractItemModel subclass for showing symbol and color ramp entities contained within a
QgsStyle
database.If you are creating a style model for the default application style (see
QgsStyle.defaultStyle()
), consider using the shared style model available atQgsApplication.defaultStyleModel()
for performance instead.See also
New in version 3.4.
QgsStyleModel(style:
QgsStyle
, parent: QObject = None) Constructor forQgsStyleModel
, for the specifiedstyle
andparent
object.The
style
object must exist for the lifetime of this model.Methods
Adds an additional icon
size
to generate for Qt.DecorationRole data.beginInsertColumns
beginInsertRows
beginMoveColumns
beginMoveRows
beginRemoveColumns
beginRemoveRows
changePersistentIndex
- param parent
createIndex
- param index
decodeData
- param index
- param section
- param row
- param index
- param parent
- param index
Returns the style managed by the model.
Attributes
- class Column¶
Bases:
int
- CompatibleGeometryTypesRole = 263¶
- EntityName = 259¶
- IsFavoriteRole = 261¶
- IsTitleRole = 266¶
- LayerTypeRole = 262¶
- Name = 0¶
- class Role¶
Bases:
int
- StyleFileName = 265¶
- StyleName = 264¶
- SymbolTypeRole = 260¶
- TagRole = 258¶
- Tags = 1¶
- TypeRole = 257¶
- 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) –
- QgsStyleModel.beginInsertColumns(self, QModelIndex, int, int)
- QgsStyleModel.beginInsertRows(self, QModelIndex, int, int)
- QgsStyleModel.beginMoveColumns(self, QModelIndex, int, int, QModelIndex, int) -> bool
- QgsStyleModel.beginMoveRows(self, QModelIndex, int, int, QModelIndex, int) -> bool
- QgsStyleModel.beginRemoveColumns(self, QModelIndex, int, int)
- QgsStyleModel.beginRemoveRows(self, QModelIndex, int, int)
- beginResetModel(self)¶
- QgsStyleModel.changePersistentIndex(self, QModelIndex, QModelIndex)
- changePersistentIndexList(self, Iterable[QModelIndex], Iterable[QModelIndex])¶
- childEvent(self, QChildEvent)¶
- columnCount(self, parent: QModelIndex = QModelIndex()) int ¶
- Parameters
parent (QModelIndex = QModelIndex()) –
- Return type
int
- connectNotify(self, QMetaMethod)¶
- QgsStyleModel.createIndex(self, int, int, object: object = 0) -> QModelIndex
- customEvent(self, QEvent)¶
- data(self, index: QModelIndex, role: int) Any ¶
- Parameters
index (QModelIndex) –
role (int) –
- Return type
Any
- QgsStyleModel.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)¶
- flags(self, index: QModelIndex) Qt.ItemFlags ¶
- Parameters
index (QModelIndex) –
- Return type
Qt.ItemFlags
- 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
- index(self, row: int, column: int, parent: QModelIndex = QModelIndex()) QModelIndex ¶
- Parameters
row (int) –
column (int) –
parent (QModelIndex = QModelIndex()) –
- Return type
QModelIndex
- isSignalConnected(self, QMetaMethod) bool ¶
- parent(self, index: QModelIndex) QModelIndex ¶
- Parameters
index (QModelIndex) –
- Return type
QModelIndex
- persistentIndexList(self) List[QModelIndex] ¶
- receivers(self, PYQT_SIGNAL) int ¶
- resetInternalData(self)¶
- rowCount(self, parent: QModelIndex = QModelIndex()) int ¶
- Parameters
parent (QModelIndex = QModelIndex()) –
- Return type
int
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- setData(self, index: QModelIndex, value: Any, role: int = Qt.EditRole) bool ¶
- Parameters
index (QModelIndex) –
value (Any) –
role (int = Qt.EditRole) –
- Return type
bool
- timerEvent(self, QTimerEvent)¶