|
QGIS API Documentation 4.3.0-Master (621ced71bd7)
|
A node contained within a QgsSymbolLayerModel. More...
#include <qgssymbollayermodel.h>
Public Member Functions | |
| QgsSymbolLayerModelNode () | |
| Constructor for QgsSymbolLayerModelNode for an empty node. | |
| QgsSymbolLayerModelNode (QgsSymbol *symbol, QgsVectorLayer *vectorLayer, QScreen *screen) | |
| Constructor for QgsSymbolLayerModelNode for a symbol node. | |
| QgsSymbolLayerModelNode (QgsSymbolLayer *layer, Qgis::SymbolType symbolType, QgsVectorLayer *vectorLayer, QScreen *screen) | |
| Constructor for QgsSymbolLayerModelNode for a symbol layer node. | |
| ~QgsSymbolLayerModelNode () | |
| QgsSymbolLayerModelNode * | addChildNode (std::unique_ptr< QgsSymbolLayerModelNode > node) |
| Adds a child node to this node, transferring ownership of the node. | |
| QgsSymbolLayerModelNode * | childAt (int index) const |
| Returns the child node at the given index. | |
| QVariant | data (int role) const |
| Returns the item's data for the given role. | |
| void | deleteChildren () |
| Deletes all child nodes from this node. | |
| QIcon | icon () const |
| Returns the item preview icon. | |
| int | indexOf (const QgsSymbolLayerModelNode *node) |
| Returns the index position of the given node within the current node's children. | |
| QgsSymbolLayerModelNode * | insertChildNode (int index, std::unique_ptr< QgsSymbolLayerModelNode > node) |
| Inserts a child node to this node at index, transferring ownership of the node. | |
| bool | isLayer () const |
Returns true if the node is a symbol layer. And otherwise, it is a symbol. | |
| bool | isRootNode () const |
Returns true if the node is a root node (i.e. has no parent). | |
| QgsSymbolLayer * | layer () |
| Returns the symbol layer pointer. | |
| void | moveChildNode (QgsSymbolLayerModelNode *node, int to) |
| Move a child node of the current node, the ownership of the moved node is transferred to the current node. | |
| QgsSymbolLayerModelNode * | parent () |
Returns the pointer of the parent node. If parent is nullptr, the node is a root node. | |
| void | removeChildNode (QgsSymbolLayerModelNode *node) |
| Remove a child node of the current node. | |
| int | rowCount () const |
| Returns the number of rows(children) belonging to the node. | |
| int | rowIndex () const |
| Returns the row index of the node within its parent. | |
| void | setLayer (QgsSymbolLayer *layer, Qgis::SymbolType symbolType) |
| Sets the layer associated with the node, and the symbolType of the QgsSymbol it belongs to. | |
| void | setScreen (QScreen *screen) |
| Sets the screen associated with the node, which is used to render the preview icons. | |
| QgsSymbol * | symbol () |
| Returns the symbol pointer; helpful in determining a layer's parent symbol. | |
Friends | |
| class | TestQgsSymbolLayerModel |
A node contained within a QgsSymbolLayerModel.
May represent a symbol or a layer.
Definition at line 41 of file qgssymbollayermodel.h.
| QgsSymbolLayerModelNode::QgsSymbolLayerModelNode | ( | ) |
Constructor for QgsSymbolLayerModelNode for an empty node.
e.g a root node.
Definition at line 36 of file qgssymbollayermodel.cpp.
| QgsSymbolLayerModelNode::QgsSymbolLayerModelNode | ( | QgsSymbolLayer * | layer, |
| Qgis::SymbolType | symbolType, | ||
| QgsVectorLayer * | vectorLayer, | ||
| QScreen * | screen ) |
Constructor for QgsSymbolLayerModelNode for a symbol layer node.
e.g a child node of a symbol.
Definition at line 39 of file qgssymbollayermodel.cpp.
| QgsSymbolLayerModelNode::QgsSymbolLayerModelNode | ( | QgsSymbol * | symbol, |
| QgsVectorLayer * | vectorLayer, | ||
| QScreen * | screen ) |
Constructor for QgsSymbolLayerModelNode for a symbol node.
Definition at line 46 of file qgssymbollayermodel.cpp.
| QgsSymbolLayerModelNode::~QgsSymbolLayerModelNode | ( | ) |
Definition at line 53 of file qgssymbollayermodel.cpp.
| QgsSymbolLayerModelNode * QgsSymbolLayerModelNode::addChildNode | ( | std::unique_ptr< QgsSymbolLayerModelNode > | node | ) |
Adds a child node to this node, transferring ownership of the node.
to this node.
Definition at line 159 of file qgssymbollayermodel.cpp.
| QgsSymbolLayerModelNode * QgsSymbolLayerModelNode::childAt | ( | int | index | ) | const |
Returns the child node at the given index.
Definition at line 210 of file qgssymbollayermodel.cpp.
| QVariant QgsSymbolLayerModelNode::data | ( | int | role | ) | const |
Returns the item's data for the given role.
Definition at line 98 of file qgssymbollayermodel.cpp.
| void QgsSymbolLayerModelNode::deleteChildren | ( | ) |
Deletes all child nodes from this node.
Definition at line 154 of file qgssymbollayermodel.cpp.
| QIcon QgsSymbolLayerModelNode::icon | ( | ) | const |
Returns the item preview icon.
Definition at line 78 of file qgssymbollayermodel.cpp.
| int QgsSymbolLayerModelNode::indexOf | ( | const QgsSymbolLayerModelNode * | node | ) |
Returns the index position of the given node within the current node's children.
Definition at line 215 of file qgssymbollayermodel.cpp.
| QgsSymbolLayerModelNode * QgsSymbolLayerModelNode::insertChildNode | ( | int | index, |
| std::unique_ptr< QgsSymbolLayerModelNode > | node ) |
Inserts a child node to this node at index, transferring ownership of the node.
to this node.
Definition at line 170 of file qgssymbollayermodel.cpp.
|
inline |
Returns true if the node is a symbol layer. And otherwise, it is a symbol.
Definition at line 72 of file qgssymbollayermodel.h.
|
inline |
Returns true if the node is a root node (i.e. has no parent).
Definition at line 118 of file qgssymbollayermodel.h.
|
inline |
Returns the symbol layer pointer.
Definition at line 84 of file qgssymbollayermodel.h.
| void QgsSymbolLayerModelNode::moveChildNode | ( | QgsSymbolLayerModelNode * | node, |
| int | to ) |
Move a child node of the current node, the ownership of the moved node is transferred to the current node.
Definition at line 181 of file qgssymbollayermodel.cpp.
|
inline |
Returns the pointer of the parent node. If parent is nullptr, the node is a root node.
Definition at line 115 of file qgssymbollayermodel.h.
| void QgsSymbolLayerModelNode::removeChildNode | ( | QgsSymbolLayerModelNode * | node | ) |
Remove a child node of the current node.
Definition at line 198 of file qgssymbollayermodel.cpp.
| int QgsSymbolLayerModelNode::rowCount | ( | ) | const |
Returns the number of rows(children) belonging to the node.
Definition at line 226 of file qgssymbollayermodel.cpp.
| int QgsSymbolLayerModelNode::rowIndex | ( | ) | const |
Returns the row index of the node within its parent.
Definition at line 231 of file qgssymbollayermodel.cpp.
| void QgsSymbolLayerModelNode::setLayer | ( | QgsSymbolLayer * | layer, |
| Qgis::SymbolType | symbolType ) |
Sets the layer associated with the node, and the symbolType of the QgsSymbol it belongs to.
Definition at line 58 of file qgssymbollayermodel.cpp.
| void QgsSymbolLayerModelNode::setScreen | ( | QScreen * | screen | ) |
Sets the screen associated with the node, which is used to render the preview icons.
Definition at line 66 of file qgssymbollayermodel.cpp.
|
inline |
Returns the symbol pointer; helpful in determining a layer's parent symbol.
Definition at line 81 of file qgssymbollayermodel.h.
|
friend |
Definition at line 158 of file qgssymbollayermodel.h.