QGIS API Documentation 3.41.0-Master (3440c17df1d)
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | List of all members
QgsStyleEntityVisitorInterface Class Reference

An interface for classes which can visit style entity (e.g. More...

#include <qgsstyleentityvisitor.h>

Classes

struct  Node
 Contains information relating to a node (i.e. More...
 
struct  StyleLeaf
 Contains information relating to the style entity currently being visited. More...
 

Public Types

enum class  NodeType : int {
  Project , Layer , SymbolRule , Layouts ,
  PrintLayout , LayoutItem , Report , ReportHeader ,
  ReportFooter , ReportSection , Annotations , Annotation
}
 Describes the types of nodes which may be visited by the visitor. More...
 

Public Member Functions

virtual ~QgsStyleEntityVisitorInterface ()=default
 
virtual bool visit (const QgsStyleEntityVisitorInterface::StyleLeaf &entity)
 Called when the visitor will visit a style entity.
 
virtual bool visitEnter (const QgsStyleEntityVisitorInterface::Node &node)
 Called when the visitor starts visiting a node.
 
virtual bool visitExit (const QgsStyleEntityVisitorInterface::Node &node)
 Called when the visitor stops visiting a node.
 

Detailed Description

An interface for classes which can visit style entity (e.g.

symbol) nodes (using the visitor pattern).

Since
QGIS 3.10

Definition at line 33 of file qgsstyleentityvisitor.h.

Member Enumeration Documentation

◆ NodeType

Describes the types of nodes which may be visited by the visitor.

Enumerator
Project 

QGIS Project node.

Layer 

Map layer.

SymbolRule 

Rule based symbology or label child rule.

Layouts 

Layout collection.

PrintLayout 

An individual print layout.

LayoutItem 

Individual item in a print layout.

Report 

A QGIS print report.

ReportHeader 

Report header section.

ReportFooter 

Report footer section.

ReportSection 

Report sub section.

Annotations 

Annotations collection.

Annotation 

An individual annotation.

Definition at line 41 of file qgsstyleentityvisitor.h.

Constructor & Destructor Documentation

◆ ~QgsStyleEntityVisitorInterface()

virtual QgsStyleEntityVisitorInterface::~QgsStyleEntityVisitorInterface ( )
virtualdefault

Member Function Documentation

◆ visit()

virtual bool QgsStyleEntityVisitorInterface::visit ( const QgsStyleEntityVisitorInterface::StyleLeaf entity)
inlinevirtual

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.

Definition at line 153 of file qgsstyleentityvisitor.h.

◆ visitEnter()

virtual bool QgsStyleEntityVisitorInterface::visitEnter ( const QgsStyleEntityVisitorInterface::Node node)
inlinevirtual

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.

Definition at line 169 of file qgsstyleentityvisitor.h.

◆ visitExit()

virtual bool QgsStyleEntityVisitorInterface::visitExit ( const QgsStyleEntityVisitorInterface::Node node)
inlinevirtual

Called when the visitor stops visiting a node.

Subclasses should return false to abort further visitations, or true to continue visiting other nodes.

The default implementation returns true.

Definition at line 183 of file qgsstyleentityvisitor.h.


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