|
QGIS API Documentation 4.3.0-Master (901db8dfa85)
|
A QAbstractItemModel subclass for displaying a QgsSymbol in a tree view in the symbology panel. More...
#include <qgssymbollayermodel.h>

Public Member Functions | |
| QgsSymbolLayerModel (QgsVectorLayer *vl, QObject *parent=nullptr, QScreen *screen=nullptr) | |
| Constructor for QgsSymbolLayerModel, with the specified parent object. | |
| QgsSymbolLayerModelNode * | addLayer (QModelIndex index) |
| Adds the symbol layer node inserted right before the idx. | |
| void | changeLayer (QgsSymbolLayerModelNode *node, QgsSymbolLayer *newLayer) |
| Change the symbol layer associated with node by a newLayer symbol layer. | |
| int | columnCount (const QModelIndex &=QModelIndex()) const override |
| QVariant | data (const QModelIndex &index, int role) const override |
| QgsSymbolLayerModelNode * | duplicateLayer (QgsSymbolLayerModelNode *node) |
| Duplicates the symbol layer node in the parent node hierarchy. | |
| Qt::ItemFlags | flags (const QModelIndex &index) const override |
| QModelIndex | index (int row, int column, const QModelIndex &parent=QModelIndex()) const override |
| QgsSymbolLayerModelNode * | index2node (const QModelIndex &index) const |
| Returns the model node corresponding to the given index. | |
| void | moveLayerByOffset (QgsSymbolLayerModelNode *node, int offset) |
| Moves the symbol layer node by the offset in the parent hierarchy. | |
| QModelIndex | node2index (QgsSymbolLayerModelNode *node) const |
| Returns the model index corresponding to the given node. | |
| QModelIndex | parent (const QModelIndex &child) const override |
| void | removeLayer (QgsSymbolLayerModelNode *node) |
| Removes the symbol layer node from it's parent node hierarchy. | |
| QgsSymbolLayerModelNode * | rootNode () const |
| Returns the root node of the model. | |
| int | rowCount (const QModelIndex &parent=QModelIndex()) const override |
| bool | setData (const QModelIndex &index, const QVariant &value, int role) override |
| void | setScreen (QScreen *screen) |
| Set the QScreen of the model itself. | |
| void | setSymbol (QgsSymbol *symbol) |
| Sets the symbol associated with the model. | |
| void | updateNode (QgsSymbol *symbol, QgsSymbolLayerModelNode *parent) |
| Updates the descendants of the given parent node with the given symbol. | |
| void | updatePreviewIcons (QgsSymbolLayerModelNode *node) |
| Updates the preview icon of the given node. | |
Friends | |
| class | TestQgsSymbolLayerModel |
A QAbstractItemModel subclass for displaying a QgsSymbol in a tree view in the symbology panel.
Definition at line 170 of file qgssymbollayermodel.h.
| QgsSymbolLayerModel::QgsSymbolLayerModel | ( | QgsVectorLayer * | vl, |
| QObject * | parent = nullptr, | ||
| QScreen * | screen = nullptr ) |
Constructor for QgsSymbolLayerModel, with the specified parent object.
Definition at line 255 of file qgssymbollayermodel.cpp.
| QgsSymbolLayerModelNode * QgsSymbolLayerModel::addLayer | ( | QModelIndex | index | ) |
Adds the symbol layer node inserted right before the idx.
Definition at line 478 of file qgssymbollayermodel.cpp.
| void QgsSymbolLayerModel::changeLayer | ( | QgsSymbolLayerModelNode * | node, |
| QgsSymbolLayer * | newLayer ) |
Change the symbol layer associated with node by a newLayer symbol layer.
Definition at line 548 of file qgssymbollayermodel.cpp.
|
override |
Definition at line 329 of file qgssymbollayermodel.cpp.
|
override |
Definition at line 282 of file qgssymbollayermodel.cpp.
| QgsSymbolLayerModelNode * QgsSymbolLayerModel::duplicateLayer | ( | QgsSymbolLayerModelNode * | node | ) |
Duplicates the symbol layer node in the parent node hierarchy.
Definition at line 439 of file qgssymbollayermodel.cpp.
|
override |
Definition at line 262 of file qgssymbollayermodel.cpp.
|
override |
Definition at line 334 of file qgssymbollayermodel.cpp.
| QgsSymbolLayerModelNode * QgsSymbolLayerModel::index2node | ( | const QModelIndex & | index | ) | const |
Returns the model node corresponding to the given index.
Returns the rootNode() for an invalid index.
Definition at line 376 of file qgssymbollayermodel.cpp.
| void QgsSymbolLayerModel::moveLayerByOffset | ( | QgsSymbolLayerModelNode * | node, |
| int | offset ) |
Moves the symbol layer node by the offset in the parent hierarchy.
Definition at line 418 of file qgssymbollayermodel.cpp.
| QModelIndex QgsSymbolLayerModel::node2index | ( | QgsSymbolLayerModelNode * | node | ) | const |
Returns the model index corresponding to the given node.
Definition at line 384 of file qgssymbollayermodel.cpp.
|
override |
Definition at line 346 of file qgssymbollayermodel.cpp.
| void QgsSymbolLayerModel::removeLayer | ( | QgsSymbolLayerModelNode * | node | ) |
Removes the symbol layer node from it's parent node hierarchy.
Definition at line 529 of file qgssymbollayermodel.cpp.
|
inline |
Returns the root node of the model.
Definition at line 254 of file qgssymbollayermodel.h.
|
override |
Definition at line 320 of file qgssymbollayermodel.cpp.
|
override |
Definition at line 294 of file qgssymbollayermodel.cpp.
| void QgsSymbolLayerModel::setScreen | ( | QScreen * | screen | ) |
Set the QScreen of the model itself.
And traverses all the nodes in the model to set their QScreen and update their preview icons.
Used to determine the icon size on different dpi monitors.
Definition at line 596 of file qgssymbollayermodel.cpp.
| void QgsSymbolLayerModel::setSymbol | ( | QgsSymbol * | symbol | ) |
Sets the symbol associated with the model.
Definition at line 586 of file qgssymbollayermodel.cpp.
| void QgsSymbolLayerModel::updateNode | ( | QgsSymbol * | symbol, |
| QgsSymbolLayerModelNode * | parent ) |
Updates the descendants of the given parent node with the given symbol.
Definition at line 404 of file qgssymbollayermodel.cpp.
| void QgsSymbolLayerModel::updatePreviewIcons | ( | QgsSymbolLayerModelNode * | node | ) |
Updates the preview icon of the given node.
And recursively updates the parents of the node.
Definition at line 572 of file qgssymbollayermodel.cpp.
|
friend |
Definition at line 270 of file qgssymbollayermodel.h.