|
QGIS API Documentation 4.1.0-Master (3b8ef1f72a3)
|
A QAbstractItemModel subclass for showing symbol and color ramp entities contained within a QgsStyle database. More...
#include <qgsstylemodel.h>

Public Types | |
| enum | Column { Name = 0 , Tags } |
| Model columns. More... | |
| enum class | CustomRole : int { Type = Qt::UserRole + 1 , Tag , EntityName , SymbolType , IsFavorite , LayerType , CompatibleGeometryTypes , StyleName , StyleFileName , IsTitle , MaterialType } |
| Custom model roles. More... | |
Public Member Functions | |
| QgsStyleModel (QgsStyle *style, QObject *parent=nullptr) | |
| Constructor for QgsStyleModel, for the specified style and parent object. | |
| void | addDesiredIconSize (QSize size) |
| Adds an additional icon size to generate for Qt::DecorationRole data. | |
| void | addTargetScreenProperties (const QgsScreenProperties &properties) |
| Adds additional target screen properties to use when generating icons for Qt::DecorationRole data. | |
| int | columnCount (const QModelIndex &parent=QModelIndex()) const override |
| QVariant | data (const QModelIndex &index, int role) const override |
| Qt::ItemFlags | flags (const QModelIndex &index) const override |
| QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override |
| QModelIndex | index (int row, int column, const QModelIndex &parent=QModelIndex()) const override |
| QModelIndex | parent (const QModelIndex &index) const override |
| int | rowCount (const QModelIndex &parent=QModelIndex()) const override |
| bool | setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override |
| QgsStyle * | style () |
| Returns the style managed by the model. | |
Static Public Member Functions | |
| static void | setIconGenerator (QgsAbstractStyleEntityIconGenerator *generator) |
| Sets the icon generator to use for deferred style entity icon generation. | |
Friends | |
| class | QgsCombinedStyleModel |
A QAbstractItemModel subclass for showing symbol and color ramp entities contained within a QgsStyle database.
If you are creating a style model for the default application style (see QgsStyle::defaultStyle()), consider using the shared style model available at QgsApplication::defaultStyleModel() for performance instead.
Definition at line 128 of file qgsstylemodel.h.
Model columns.
| Enumerator | |
|---|---|
| Name | Name column. |
| Tags | Tags column. |
Definition at line 134 of file qgsstylemodel.h.
|
strong |
Custom model roles.
| Enumerator | |
|---|---|
| Type | Style entity type, see QgsStyle::StyleEntity. |
| Tag | String list of tags. |
| EntityName | Entity name.
|
| SymbolType | Symbol type (for symbol or legend patch shape entities). |
| IsFavorite | Whether entity is flagged as a favorite. |
| LayerType | Layer type (for label settings entities). |
| CompatibleGeometryTypes | Compatible layer geometry types (for 3D symbols). |
| StyleName | Name of associated QgsStyle (QgsStyle::name()).
|
| StyleFileName | File name of associated QgsStyle (QgsStyle::fileName()).
|
| IsTitle | True if the index corresponds to a title item.
|
| MaterialType | Material type (for material entities).
|
Definition at line 148 of file qgsstylemodel.h.
|
explicit |
Constructor for QgsStyleModel, for the specified style and parent object.
The style object must exist for the lifetime of this model.
Definition at line 77 of file qgsstylemodel.cpp.
| void QgsStyleModel::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 689 of file qgsstylemodel.cpp.
| void QgsStyleModel::addTargetScreenProperties | ( | const QgsScreenProperties & | properties | ) |
Adds additional target screen properties to use when generating icons for Qt::DecorationRole data.
This allows style icons to be generated at an icon device pixel ratio and DPI which corresponds exactly to the view's screen properties in which this model is used.
Definition at line 702 of file qgsstylemodel.cpp.
|
override |
Definition at line 684 of file qgsstylemodel.cpp.
|
override |
Definition at line 127 of file qgsstylemodel.cpp.
|
override |
Definition at line 606 of file qgsstylemodel.cpp.
|
override |
Definition at line 619 of file qgsstylemodel.cpp.
|
override |
Definition at line 653 of file qgsstylemodel.cpp.
|
override |
Definition at line 666 of file qgsstylemodel.cpp.
|
override |
Definition at line 672 of file qgsstylemodel.cpp.
|
override |
Definition at line 570 of file qgsstylemodel.cpp.
|
static |
Sets the icon generator to use for deferred style entity icon generation.
Currently this is used for 3D symbol icons only.
Definition at line 715 of file qgsstylemodel.cpp.
|
inline |
Returns the style managed by the model.
Definition at line 177 of file qgsstylemodel.h.
|
friend |
Definition at line 250 of file qgsstylemodel.h.