Class: QgsProjectStyleDatabaseModel¶
List model representing the style databases associated with a
QgsProject
.
Added in version 3.26.
Class Hierarchy¶
Base classes¶
Enums
Custom model roles. |
|
alias of |
Methods
Returns the model index corresponding to a style. |
|
Sets whether the default style should also be included in the model. |
|
Returns |
|
Returns the style at the corresponding index. |
- class qgis.core.QgsProjectStyleDatabaseModel[source]¶
Bases:
QAbstractListModel
- __init__(settings: QgsProjectStyleSettings | None, parent: QObject | None = None)
Constructor for QgsProjectStyleDatabaseModel, showing the styles from the specified
settings
.- Parameters:
settings (Optional[QgsProjectStyleSettings])
parent (Optional[QObject] = None)
- class CustomRole(*values)¶
Bases:
IntEnum
Custom model roles.
Note
Prior to QGIS 3.36 this was available as QgsProjectStyleDatabaseModel.Role
Added in version 3.36.
Style
: Style objectAvailable as
QgsProjectStyleDatabaseModel.StyleRole
in older QGIS releases.Path
: Style pathAvailable as
QgsProjectStyleDatabaseModel.PathRole
in older QGIS releases.
- Role¶
alias of
CustomRole
- indexFromStyle(self, style: QgsStyle | None) QModelIndex [source]¶
Returns the model index corresponding to a
style
.See also
- Parameters:
style (Optional[QgsStyle])
- Return type:
QModelIndex
- setShowDefaultStyle(self, show: bool)[source]¶
Sets whether the default style should also be included in the model.
See also
- Parameters:
show (bool)
- showDefaultStyle(self) bool [source]¶
Returns
True
if the model includes the default style.See also
- Return type:
bool