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:
QgsProjectStyleSettings
, parent: QObject = None) Constructor forQgsProjectStyleDatabaseModel
, showing the styles from the specifiedsettings
.Enums
Bases:
enum.IntEnum
alias of
CustomRole
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
.- class CustomRole(value)¶
Bases:
enum.IntEnum
Custom model roles.
Note
Prior to QGIS 3.36 this was available as QgsProjectStyleDatabaseModel.Role
Added in version 3.36.
StyleRole
: Style objectPathRole
: Style path
- baseClass¶
alias of
QgsProjectStyleDatabaseModel
- Role¶
alias of
CustomRole
- 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)¶
- data(self, index: QModelIndex, role: int) Any ¶
- Parameters:
index (QModelIndex)
role (int)
- Return type:
Any
- 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)¶
- indexFromStyle(self, style: QgsStyle) QModelIndex ¶
Returns the model index corresponding to a
style
.See also
- Parameters:
style (QgsStyle)
- Return type:
QModelIndex
- isSignalConnected(self, QMetaMethod) bool ¶
- persistentIndexList(self) List[QModelIndex] ¶
- receivers(self, PYQT_SIGNAL) int ¶
- resetInternalData(self)¶
- rowCount(self, parent: QModelIndex) int ¶
- Parameters:
parent (QModelIndex)
- Return type:
int
- sender(self) QObject ¶
- 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 ¶
Returns the style at the corresponding
index
.See also
- Parameters:
index (QModelIndex)
- Return type:
- timerEvent(self, QTimerEvent)¶