Class: QgsProjectStyleDatabaseModel¶
- class qgis.core.QgsProjectStyleDatabaseModel¶
Bases:
PyQt5.QtCore.QAbstractListModel
List model representing the style databases associated with a
QgsProject
.New in version 3.26.
QgsProjectStyleDatabaseModel(settings:
QgsProjectStyleSettings
, parent: QObject = None) Constructor forQgsProjectStyleDatabaseModel
, showing the styles from the specifiedsettings
.Methods
beginInsertColumns
beginInsertRows
beginMoveColumns
beginMoveRows
beginRemoveColumns
beginRemoveRows
changePersistentIndex
createIndex
- param index:
decodeData
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
.Attributes
- PathRole = 258¶
- class Role¶
Bases:
int
- StyleRole = 257¶
- QgsProjectStyleDatabaseModel.beginInsertColumns(self, QModelIndex, int, int)
- QgsProjectStyleDatabaseModel.beginInsertRows(self, QModelIndex, int, int)
- QgsProjectStyleDatabaseModel.beginMoveColumns(self, QModelIndex, int, int, QModelIndex, int) -> bool
- QgsProjectStyleDatabaseModel.beginMoveRows(self, QModelIndex, int, int, QModelIndex, int) -> bool
- QgsProjectStyleDatabaseModel.beginRemoveColumns(self, QModelIndex, int, int)
- QgsProjectStyleDatabaseModel.beginRemoveRows(self, QModelIndex, int, int)
- beginResetModel(self)¶
- QgsProjectStyleDatabaseModel.changePersistentIndex(self, QModelIndex, QModelIndex)
- changePersistentIndexList(self, Iterable[QModelIndex], Iterable[QModelIndex])¶
- childEvent(self, QChildEvent)¶
- connectNotify(self, QMetaMethod)¶
- QgsProjectStyleDatabaseModel.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
- QgsProjectStyleDatabaseModel.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)¶