|
QGIS API Documentation 4.3.0-Master (621ced71bd7)
|
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. | |
| 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 |
| 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 | updatePreview (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 167 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 239 of file qgssymbollayermodel.cpp.
| QgsSymbolLayerModelNode * QgsSymbolLayerModel::addLayer | ( | QModelIndex | index | ) |
Adds the symbol layer node inserted right before the idx.
Definition at line 417 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 487 of file qgssymbollayermodel.cpp.
|
override |
Definition at line 268 of file qgssymbollayermodel.cpp.
|
override |
Definition at line 247 of file qgssymbollayermodel.cpp.
| QgsSymbolLayerModelNode * QgsSymbolLayerModel::duplicateLayer | ( | QgsSymbolLayerModelNode * | node | ) |
Duplicates the symbol layer node in the parent node hierarchy.
Definition at line 378 of file qgssymbollayermodel.cpp.
|
override |
Definition at line 273 of file qgssymbollayermodel.cpp.
| QgsSymbolLayerModelNode * QgsSymbolLayerModel::index2node | ( | const QModelIndex & | index | ) | const |
Returns the model node corresponding to the given index.
Definition at line 315 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 357 of file qgssymbollayermodel.cpp.
| QModelIndex QgsSymbolLayerModel::node2index | ( | QgsSymbolLayerModelNode * | node | ) | const |
Returns the model index corresponding to the given node.
Definition at line 323 of file qgssymbollayermodel.cpp.
|
override |
Definition at line 285 of file qgssymbollayermodel.cpp.
| void QgsSymbolLayerModel::removeLayer | ( | QgsSymbolLayerModelNode * | node | ) |
Removes the symbol layer node from it's parent node hierarchy.
Definition at line 468 of file qgssymbollayermodel.cpp.
|
inline |
Returns the root node of the model.
Definition at line 245 of file qgssymbollayermodel.h.
|
override |
Definition at line 259 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 532 of file qgssymbollayermodel.cpp.
| void QgsSymbolLayerModel::setSymbol | ( | QgsSymbol * | symbol | ) |
Sets the symbol associated with the model.
Definition at line 522 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 343 of file qgssymbollayermodel.cpp.
| void QgsSymbolLayerModel::updatePreview | ( | QgsSymbolLayerModelNode * | node | ) |
Updates the preview icon of the given node.
And recursively updates the parents of the node.
Definition at line 511 of file qgssymbollayermodel.cpp.
|
friend |
Definition at line 261 of file qgssymbollayermodel.h.