QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
Public Types | Public Member Functions | List of all members
SymbolLayerVisitor Class Reference

Generic visitor that collects symbol layers of a vector layer's renderer and call a callback function on them with their corresponding QgsSymbolLayerId. More...

Inheritance diagram for SymbolLayerVisitor:
Inheritance graph
[legend]

Public Types

typedef std::function< void(const QgsSymbolLayer *, const QgsSymbolLayerId &)> SymbolLayerCallback
 
- Public Types inherited from QgsStyleEntityVisitorInterface
enum  NodeType : int {
  NodeType::Project, NodeType::Layer, NodeType::SymbolRule, NodeType::Layouts,
  NodeType::PrintLayout, NodeType::LayoutItem, NodeType::Report, NodeType::ReportHeader,
  NodeType::ReportFooter, NodeType::ReportSection, NodeType::Annotations, NodeType::Annotation
}
 Describes the types of nodes which may be visited by the visitor. More...
 

Public Member Functions

 SymbolLayerVisitor (SymbolLayerCallback callback)
 constructor More...
 
bool visit (const QgsStyleEntityVisitorInterface::StyleLeaf &leaf) override
 Called when the visitor will visit a style entity. More...
 
bool visitEnter (const QgsStyleEntityVisitorInterface::Node &node) override
 Called when the visitor starts visiting a node. More...
 
void visitSymbol (const QgsSymbol *symbol, const QString &leafIdentifier, QVector< int > rootPath)
 Process a symbol. More...
 
- Public Member Functions inherited from QgsStyleEntityVisitorInterface
virtual ~QgsStyleEntityVisitorInterface ()=default
 
virtual bool visitExit (const QgsStyleEntityVisitorInterface::Node &node)
 Called when the visitor stops visiting a node. More...
 

Detailed Description

Generic visitor that collects symbol layers of a vector layer's renderer and call a callback function on them with their corresponding QgsSymbolLayerId.

Note
This class is not a part of public API
Since
QGIS 3.14

Definition at line 86 of file qgsmaskingwidget.cpp.

Member Typedef Documentation

◆ SymbolLayerCallback

typedef std::function<void( const QgsSymbolLayer *, const QgsSymbolLayerId & )> SymbolLayerVisitor::SymbolLayerCallback

Definition at line 89 of file qgsmaskingwidget.cpp.

Constructor & Destructor Documentation

◆ SymbolLayerVisitor()

SymbolLayerVisitor::SymbolLayerVisitor ( SymbolLayerCallback  callback)
inline

constructor

Definition at line 92 of file qgsmaskingwidget.cpp.

Member Function Documentation

◆ visit()

bool SymbolLayerVisitor::visit ( const QgsStyleEntityVisitorInterface::StyleLeaf entity)
inlineoverridevirtual

Called when the visitor will visit a style entity.

Subclasses should return false to abort further visitations, or true to continue visiting after processing this entity.

Reimplemented from QgsStyleEntityVisitorInterface.

Definition at line 124 of file qgsmaskingwidget.cpp.

◆ visitEnter()

bool SymbolLayerVisitor::visitEnter ( const QgsStyleEntityVisitorInterface::Node node)
inlineoverridevirtual

Called when the visitor starts visiting a node.

Subclasses should return false if they do NOT want to visit this particular node - e.g. if the node type is QgsStyleEntityVisitorInterface::NodeType::Layouts and they do not wish to visit layout objects. In this case the visitor will not process the node, and will move to the next available node instead. Return true to proceed with visiting the node.

The default implementation returns true.

Reimplemented from QgsStyleEntityVisitorInterface.

Definition at line 96 of file qgsmaskingwidget.cpp.

◆ visitSymbol()

void SymbolLayerVisitor::visitSymbol ( const QgsSymbol symbol,
const QString &  leafIdentifier,
QVector< int >  rootPath 
)
inline

Process a symbol.

Definition at line 106 of file qgsmaskingwidget.cpp.


The documentation for this class was generated from the following file: