Class: QgsProjectStyleDatabaseModel¶
- class qgis.core.QgsProjectStyleDatabaseModel¶
Bases:
PyQt5.QtCore.QAbstractListModel
List model representing the style databases associated with a
QgsProject
.Added in version 3.26.
QgsProjectStyleDatabaseModel(settings: Optional[QgsProjectStyleSettings], parent: Optional[QObject] = None) Constructor for
QgsProjectStyleDatabaseModel
, showing the styles from the specifiedsettings
.Methods
- param index:
Returns the model index corresponding to a
style
.- param parent:
Sets whether the default style should also be included in the model.
Returns
True
if the model includes the default style.Returns the style at the corresponding
index
.Signals
Attributes
- PathRole = 258¶
- class Role¶
Bases:
int
- StyleRole = 257¶
- beginInsertColumns(self, parent: QModelIndex, first: int, last: int)¶
- beginInsertRows(self, parent: QModelIndex, first: int, last: int)¶
- beginMoveColumns(self, sourceParent: QModelIndex, sourceFirst: int, sourceLast: int, destinationParent: QModelIndex, destinationColumn: int) bool ¶
- beginMoveRows(self, sourceParent: QModelIndex, sourceFirst: int, sourceLast: int, destinationParent: QModelIndex, destinationRow: int) bool ¶
- beginRemoveColumns(self, parent: QModelIndex, first: int, last: int)¶
- beginRemoveRows(self, parent: QModelIndex, first: int, last: int)¶
- beginResetModel(self)¶
- changePersistentIndex(self, from_: QModelIndex, to: QModelIndex)¶
- changePersistentIndexList(self, from_: Iterable[QModelIndex], to: Iterable[QModelIndex])¶
- childEvent(self, a0: QChildEvent | None)¶
- connectNotify(self, signal: QMetaMethod)¶
- createIndex(self, row: int, column: int, object: Any = None) QModelIndex ¶
- customEvent(self, a0: QEvent | None)¶
- data(self, index: QModelIndex, role: int) Any ¶
- Parameters:
index (QModelIndex)
role (int)
- Return type:
Any
- decodeData(self, row: int, column: int, parent: QModelIndex, stream: QDataStream) bool ¶
- disconnectNotify(self, signal: QMetaMethod)¶
- encodeData(self, indexes: Iterable[QModelIndex], stream: QDataStream)¶
- endInsertColumns(self)¶
- endInsertRows(self)¶
- endMoveColumns(self)¶
- endMoveRows(self)¶
- endRemoveColumns(self)¶
- endRemoveRows(self)¶
- endResetModel(self)¶
- indexFromStyle(self, style: QgsStyle | None) QModelIndex ¶
Returns the model index corresponding to a
style
.See also
- Parameters:
style (Optional[QgsStyle])
- Return type:
QModelIndex
- isSignalConnected(self, signal: QMetaMethod) bool ¶
- persistentIndexList(self) List[QModelIndex] ¶
- receivers(self, signal: PYQT_SIGNAL) int ¶
- resetInternalData(self)¶
- rowCount(self, parent: QModelIndex) int ¶
- Parameters:
parent (QModelIndex)
- Return type:
int
- sender(self) QObject | None ¶
- senderSignalIndex(self) int ¶
- setShowDefaultStyle(self, show: bool)¶
Sets whether the default style should also be included in the model.
See also
- Parameters:
show (bool)
- showDefaultStyle(self) bool ¶
Returns
True
if the model includes the default style.See also
- Return type:
bool
- styleFromIndex(self, index: QModelIndex) QgsStyle | None ¶
Returns the style at the corresponding
index
.See also
- Parameters:
index (QModelIndex)
- Return type:
Optional[QgsStyle]
- timerEvent(self, a0: QTimerEvent | None)¶