QGIS API Documentation
3.4.15-Madeira (e83d02e274)
|
A QSortFilterProxyModel subclass for showing filtered symbol and color ramps entries from a QgsStyle database. More...
#include <qgsstylemodel.h>
Public Slots | |
void | setFilterString (const QString &filter) |
Sets a filter string, such that only symbol entities with names matching the specified string will be shown. More... | |
Public Member Functions | |
QgsStyleProxyModel (QgsStyle *style, QObject *parent=nullptr) | |
Constructor for QgsStyleProxyModel, for the specified style and parent object. More... | |
void | addDesiredIconSize (QSize size) |
Adds an additional icon size to generate for Qt::DecorationRole data. More... | |
QgsStyle::StyleEntity | entityFilter () const |
Returns the style entity type filter. More... | |
bool | entityFilterEnabled () const |
Returns true if filtering by entity type is enabled. More... | |
bool | favoritesOnly () const |
Returns true if the model is showing only favorited entities. More... | |
bool | filterAcceptsRow (int source_row, const QModelIndex &source_parent) const override |
QString | filterString () const |
Returns the current filter string, if set. More... | |
void | setEntityFilter (QgsStyle::StyleEntity filter) |
Sets the style entity type filter. More... | |
void | setEntityFilterEnabled (bool enabled) |
Sets whether filtering by entity type is enabled. More... | |
void | setFavoritesOnly (bool favoritesOnly) |
Sets whether the model should show only favorited entities. More... | |
void | setSmartGroupId (int id) |
Sets a smart group id to filter style entities by. More... | |
void | setSymbolType (QgsSymbol::SymbolType type) |
Sets the symbol type filter. More... | |
void | setSymbolTypeFilterEnabled (bool enabled) |
Sets whether filtering by symbol type is enabled. More... | |
void | setTagId (int id) |
Sets a tag id to filter style entities by. More... | |
int | smartGroupId () const |
Returns the smart group id used to filter style entities by. More... | |
QgsSymbol::SymbolType | symbolType () const |
Returns the symbol type filter. More... | |
bool | symbolTypeFilterEnabled () const |
Returns true if filtering by symbol type is enabled. More... | |
int | tagId () const |
Returns the tag id used to filter style entities by. More... | |
A QSortFilterProxyModel subclass for showing filtered symbol and color ramps entries from a QgsStyle database.
Definition at line 123 of file qgsstylemodel.h.
|
explicit |
Constructor for QgsStyleProxyModel, for the specified style and parent object.
The style object must exist for the lifetime of this model.
Definition at line 453 of file qgsstylemodel.cpp.
void QgsStyleProxyModel::addDesiredIconSize | ( | QSize | size | ) |
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.
Definition at line 576 of file qgsstylemodel.cpp.
QgsStyle::StyleEntity QgsStyleProxyModel::entityFilter | ( | ) | const |
Returns the style entity type filter.
Definition at line 658 of file qgsstylemodel.cpp.
bool QgsStyleProxyModel::entityFilterEnabled | ( | ) | const |
Returns true if filtering by entity type is enabled.
Definition at line 647 of file qgsstylemodel.cpp.
bool QgsStyleProxyModel::favoritesOnly | ( | ) | const |
Returns true if the model is showing only favorited entities.
Definition at line 555 of file qgsstylemodel.cpp.
|
override |
Definition at line 492 of file qgsstylemodel.cpp.
|
inline |
Returns the current filter string, if set.
Definition at line 141 of file qgsstylemodel.h.
void QgsStyleProxyModel::setEntityFilter | ( | QgsStyle::StyleEntity | filter | ) |
Sets the style entity type filter.
Definition at line 663 of file qgsstylemodel.cpp.
void QgsStyleProxyModel::setEntityFilterEnabled | ( | bool | enabled | ) |
Sets whether filtering by entity type is enabled.
If enabled is false, then the value of entityFilter() will have no effect on the model filtering.
Definition at line 652 of file qgsstylemodel.cpp.
void QgsStyleProxyModel::setFavoritesOnly | ( | bool | favoritesOnly | ) |
Sets whether the model should show only favorited entities.
Definition at line 560 of file qgsstylemodel.cpp.
|
slot |
Sets a filter string, such that only symbol entities with names matching the specified string will be shown.
Definition at line 549 of file qgsstylemodel.cpp.
void QgsStyleProxyModel::setSmartGroupId | ( | int | id | ) |
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.
Definition at line 614 of file qgsstylemodel.cpp.
void QgsStyleProxyModel::setSymbolType | ( | QgsSymbol::SymbolType | type | ) |
Sets the symbol type filter.
Definition at line 641 of file qgsstylemodel.cpp.
void QgsStyleProxyModel::setSymbolTypeFilterEnabled | ( | bool | enabled | ) |
Sets whether filtering by symbol type is enabled.
If enabled is false, then the value of symbolType() will have no effect on the model filtering. This has no effect on non-symbol entities (i.e. color ramps).
Definition at line 586 of file qgsstylemodel.cpp.
void QgsStyleProxyModel::setTagId | ( | int | id | ) |
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.
Definition at line 592 of file qgsstylemodel.cpp.
int QgsStyleProxyModel::smartGroupId | ( | ) | const |
Returns the smart group id used to filter style entities by.
If returned value is -1, then no smart group filtering is being conducted.
Definition at line 631 of file qgsstylemodel.cpp.
QgsSymbol::SymbolType QgsStyleProxyModel::symbolType | ( | ) | const |
Returns the symbol type filter.
Definition at line 636 of file qgsstylemodel.cpp.
bool QgsStyleProxyModel::symbolTypeFilterEnabled | ( | ) | const |
Returns true if filtering by symbol type is enabled.
Definition at line 581 of file qgsstylemodel.cpp.
int QgsStyleProxyModel::tagId | ( | ) | const |
Returns the tag id used to filter style entities by.
If returned value is -1, then no tag filtering is being conducted.
Definition at line 609 of file qgsstylemodel.cpp.