Class: QgsStyleProxyModel¶
- class qgis.core.QgsStyleProxyModel¶
Bases:
PyQt5.QtCore.QSortFilterProxyModel
A QSortFilterProxyModel subclass for showing filtered symbol and color ramps entries from a
QgsStyle
database.See also
New in version 3.4.
QgsStyleProxyModel(style:
QgsStyle
, parent: QObject = None) Constructor forQgsStyleProxyModel
, for the specifiedstyle
andparent
object.The
style
object must exist for the lifetime of this model.QgsStyleProxyModel(model:
QgsStyleModel
, parent: QObject = None) Constructor forQgsStyleProxyModel
, using the specified sourcemodel
andparent
object.The source
model
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
createIndex
decodeData
Returns the style entity type filter.
Returns
True
if filtering by entity type is enabled.Returns
True
if the model is showing only favorited entities.- param source_row
Returns the current filter string, if set.
Returns the layer type filter, or
QgsWkbTypes
.UnknownGeometry if no layer type filter is present.lessThan
Sets the style entity type
filter
.Sets whether filtering by entity type is
enabled
.Sets whether the model should show only favorited entities.
Sets a
filter
string, such that only symbol entities with names matching the specified string will be shown.Sets the layer
type
filter.Sets a smart group
id
to filter style entities by.Sets the symbol
type
filter.Sets whether filtering by symbol type is
enabled
.Sets a tag
id
to filter style entities by.Returns the smart group id used to filter style entities by.
Returns the symbol type filter.
Returns
True
if filtering by symbol type is enabled.Returns the tag id used to filter style entities by.
- 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) –
- QgsStyleProxyModel.beginInsertColumns(self, QModelIndex, int, int)
- QgsStyleProxyModel.beginInsertRows(self, QModelIndex, int, int)
- QgsStyleProxyModel.beginMoveColumns(self, QModelIndex, int, int, QModelIndex, int) -> bool
- QgsStyleProxyModel.beginMoveRows(self, QModelIndex, int, int, QModelIndex, int) -> bool
- QgsStyleProxyModel.beginRemoveColumns(self, QModelIndex, int, int)
- QgsStyleProxyModel.beginRemoveRows(self, QModelIndex, int, int)
- beginResetModel(self)¶
- QgsStyleProxyModel.changePersistentIndex(self, QModelIndex, QModelIndex)
- changePersistentIndexList(self, Iterable[QModelIndex], Iterable[QModelIndex])¶
- childEvent(self, QChildEvent)¶
- connectNotify(self, QMetaMethod)¶
- QgsStyleProxyModel.createIndex(self, int, int, object: object = 0) -> QModelIndex
- customEvent(self, QEvent)¶
- QgsStyleProxyModel.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)¶
- entityFilter(self) QgsStyle.StyleEntity ¶
Returns the style entity type filter.
Note
This filter is only active if
entityFilterEnabled()
isTrue
.See also
- Return type
- entityFilterEnabled(self) bool ¶
Returns
True
if filtering by entity type is enabled.See also
See also
- Return type
bool
- favoritesOnly(self) bool ¶
Returns
True
if the model is showing only favorited entities.See also
- Return type
bool
- filterAcceptsColumn(self, int, QModelIndex) bool ¶
- filterAcceptsRow(self, source_row: int, source_parent: QModelIndex) bool ¶
- Parameters
source_row (int) –
source_parent (QModelIndex) –
- Return type
bool
- filterString(self) str ¶
Returns the current filter string, if set.
See also
- Return type
str
- invalidateFilter(self)¶
- isSignalConnected(self, QMetaMethod) bool ¶
- layerType(self) QgsWkbTypes.GeometryType ¶
Returns the layer type filter, or
QgsWkbTypes
.UnknownGeometry if no layer type filter is present.This setting has an effect on label settings entities and 3d symbols only.
See also
- Return type
- QgsStyleProxyModel.lessThan(self, QModelIndex, QModelIndex) -> bool
- persistentIndexList(self) List[QModelIndex] ¶
- receivers(self, PYQT_SIGNAL) int ¶
- resetInternalData(self)¶
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- setEntityFilter(self, filter: QgsStyle.StyleEntity)¶
Sets the style entity type
filter
.Note
This filter is only active if
entityFilterEnabled()
isTrue
.See also
- Parameters
filter (QgsStyle.StyleEntity) –
- setEntityFilterEnabled(self, enabled: bool)¶
Sets whether filtering by entity type is
enabled
.If
enabled
isFalse
, then the value ofentityFilter()
will have no effect on the model filtering.See also
See also
- Parameters
enabled (bool) –
- setFavoritesOnly(self, favoritesOnly: bool)¶
Sets whether the model should show only favorited entities.
See also
- Parameters
favoritesOnly (bool) –
- setFilterString(self, filter: str)¶
Sets a
filter
string, such that only symbol entities with names matching the specified string will be shown.See also
- Parameters
filter (str) –
- setLayerType(self, type: QgsWkbTypes.GeometryType)¶
Sets the layer
type
filter. Settype
toQgsWkbTypes
.UnknownGeometry if no layer type filter is desired.See also
- Parameters
type (QgsWkbTypes.GeometryType) –
- setSmartGroupId(self, id: int)¶
Sets a smart group
id
to filter style entities by. Only entities within the given smart group will be shown in the model.Set
id
to -1 to disable smart group filtering.See also
- Parameters
id (int) –
- setSymbolType(self, type: Qgis.SymbolType)¶
Sets the symbol
type
filter.Note
This filter is only active if Qgis.SymbolTypeFilterEnabled() is
True
.See also
Qgis.SymbolType
- Parameters
type (Qgis.SymbolType) –
- setSymbolTypeFilterEnabled(self, enabled: bool)¶
Sets whether filtering by symbol type is
enabled
.If
enabled
isFalse
, then the value of Qgis.SymbolType() will have no effect on the model filtering. This has no effect on non-symbol entities (i.e. color ramps).See also
Qgis.SymbolTypeFilterEnabled
See also
- Parameters
enabled (bool) –
- setTagId(self, id: int)¶
Sets a tag
id
to filter style entities by. Only entities with the given tag will be shown in the model.Set
id
to -1 to disable tag filtering.See also
- Parameters
id (int) –
- smartGroupId(self) int ¶
Returns the smart group id used to filter style entities by.
If returned value is -1, then no smart group filtering is being conducted.
See also
- Return type
int
- symbolType(self) Qgis.SymbolType ¶
Returns the symbol type filter.
Note
This filter is only active if Qgis.SymbolTypeFilterEnabled() is
True
, and has no effect on non-symbol entities (i.e. color ramps).See also
- Return type
- symbolTypeFilterEnabled(self) bool ¶
Returns
True
if filtering by symbol type is enabled.See also
See also
Qgis.SymbolType
- Return type
bool
- tagId(self) int ¶
Returns the tag id used to filter style entities by.
If returned value is -1, then no tag filtering is being conducted.
See also
- Return type
int
- timerEvent(self, QTimerEvent)¶