QGIS API Documentation 3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
QgsSymbolLayerId Class Reference

We may need stable references to symbol layers, when pointers to symbol layers are not usable (when a symbol or a feature renderer is cloned for example). More...

#include <qgssymbollayerreference.h>

Public Member Functions

 QgsSymbolLayerId ()
 QgsSymbolLayerId (const QgsSymbolLayerId &other)=default
 QgsSymbolLayerId (const QString &key, const QVector< int > &indexPath)
 QgsSymbolLayerId constructor with a symbol key and an index path.
 QgsSymbolLayerId (const QString &key, int index)
 QgsSymbolLayerId constructor with a symbol key and a unique symbol layer index.
bool operator< (const QgsSymbolLayerId &other) const
 Comparison operator, for storage in a QSet or QMap.
QgsSymbolLayerIdoperator= (const QgsSymbolLayerId &other)=default
bool operator== (const QgsSymbolLayerId &other) const
QString symbolKey () const
 Returns the key associated to the symbol.
QVector< int > symbolLayerIndexPath () const
 Returns the symbol layer index path inside the symbol.

Detailed Description

We may need stable references to symbol layers, when pointers to symbol layers are not usable (when a symbol or a feature renderer is cloned for example).

A symbol layer identifier consists of:

  • an identifier to its symbol (given by the QgsFeatureRenderer)
  • a path of indexes inside its symbol and subsymbols.

For a symbol in a QgsSingleSymbolRenderer that has two symbol layers, it will give:

  • "" for the symbol key
  • [0] and [1] for the two symbol layer indexes

For a QgsRuleBasedRenderer each rule key is the symbol key.

For a symbol with a symbol layer that has a sub symbol (say a QgsArrowSymbolLayer), path to symbol layers of the sub symbol are given by a list of indexes:

  • [0, 0] : first symbol layer of the sub symbol of the first symbol layer
  • [0, 1] : second symbol layer of the sub symbol of the first symbol layer
  • [2, 0] : first symbol layer of the sub symbol of the third symbol layer, etc.
Since
QGIS 3.12
Deprecated
QGIS 3.30. Replaced by QUuid to identify symbol layers.

Definition at line 58 of file qgssymbollayerreference.h.

Constructor & Destructor Documentation

◆ QgsSymbolLayerId() [1/4]

QgsSymbolLayerId::QgsSymbolLayerId ( )
inline

Definition at line 61 of file qgssymbollayerreference.h.

◆ QgsSymbolLayerId() [2/4]

QgsSymbolLayerId::QgsSymbolLayerId ( const QString & key,
int index )
inline

QgsSymbolLayerId constructor with a symbol key and a unique symbol layer index.

Definition at line 66 of file qgssymbollayerreference.h.

◆ QgsSymbolLayerId() [3/4]

QgsSymbolLayerId::QgsSymbolLayerId ( const QString & key,
const QVector< int > & indexPath )
inline

QgsSymbolLayerId constructor with a symbol key and an index path.

Definition at line 73 of file qgssymbollayerreference.h.

◆ QgsSymbolLayerId() [4/4]

QgsSymbolLayerId::QgsSymbolLayerId ( const QgsSymbolLayerId & other)
default

Member Function Documentation

◆ operator<()

bool QgsSymbolLayerId::operator< ( const QgsSymbolLayerId & other) const
inline

Comparison operator, for storage in a QSet or QMap.

Definition at line 98 of file qgssymbollayerreference.h.

◆ operator=()

QgsSymbolLayerId & QgsSymbolLayerId::operator= ( const QgsSymbolLayerId & other)
default

◆ operator==()

bool QgsSymbolLayerId::operator== ( const QgsSymbolLayerId & other) const
inline

Definition at line 92 of file qgssymbollayerreference.h.

◆ symbolKey()

QString QgsSymbolLayerId::symbolKey ( ) const
inline

Returns the key associated to the symbol.

Definition at line 83 of file qgssymbollayerreference.h.

◆ symbolLayerIndexPath()

QVector< int > QgsSymbolLayerId::symbolLayerIndexPath ( ) const
inline

Returns the symbol layer index path inside the symbol.

Definition at line 88 of file qgssymbollayerreference.h.


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