16#ifndef QGSSYMBOLLAYERREFERENCE_H
17#define QGSSYMBOLLAYERREFERENCE_H
28using namespace Qt::StringLiterals;
71 , mIndexPath( { index } )
79 , mIndexPath( { indexPath } )
100 bool operator<(
const QgsSymbolLayerId &other )
const {
return ( mSymbolKey == other.mSymbolKey ) ? mIndexPath < other.mIndexPath : mSymbolKey < other.mSymbolKey; }
104 SIP_PYOBJECT __repr__();
107 QStringList pathString;
108 for (
int path : sipCpp->symbolLayerIndexPath() )
110 pathString.append( QString::number( path ) );
112 QString str = u
"<QgsSymbolLayerId: %1 (%2)>"_s.arg( sipCpp->symbolKey(), pathString.join(
',' ) );
113 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
125 QVector<int> mIndexPath;
178 return mLayerId == other.mLayerId && mSymbolLayerId == other.mSymbolLayerId && mDeprecatedSymbolLayerId == other.mDeprecatedSymbolLayerId;
183 SIP_PYOBJECT __repr__();
186 QStringList pathString;
187 for (
int path : sipCpp->symbolLayerId().symbolLayerIndexPath() )
189 pathString.append( QString::number( path ) );
191 QString str = u
"<QgsSymbolLayerReference: %1 - %2>"_s.arg( sipCpp->layerId(), sipCpp->symbolLayerIdV2() );
192 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
203 QgsSymbolLayerId mDeprecatedSymbolLayerId;
205 QString mSymbolLayerId;
210 return qHash(
id.symbolKey() ) ^
qHash(
id.symbolLayerIndexPath() );
We may need stable references to symbol layers, when pointers to symbol layers are not usable (when a...
bool operator<(const QgsSymbolLayerId &other) const
Comparison operator, for storage in a QSet or QMap.
QgsSymbolLayerId & operator=(const QgsSymbolLayerId &other)=default
bool operator==(const QgsSymbolLayerId &other) const
QVector< int > symbolLayerIndexPath() const
Returns the symbol layer index path inside the symbol.
QgsSymbolLayerId(const QgsSymbolLayerId &other)=default
QgsSymbolLayerId(const QString &key, int index)
QgsSymbolLayerId constructor with a symbol key and a unique symbol layer index.
QString symbolKey() const
Returns the key associated to the symbol.
QgsSymbolLayerId(const QString &key, const QVector< int > &indexPath)
QgsSymbolLayerId constructor with a symbol key and an index path.
Type used to refer to a specific symbol layer in a symbol of a layer.
bool operator==(const QgsSymbolLayerReference &other) const
QString symbolLayerIdV2() const
The symbol layer's id.
Q_DECL_DEPRECATED QgsSymbolLayerId symbolLayerId() const
The symbol layer's id.
QString layerId() const
The referenced vector layer / feature renderer.
QgsSymbolLayerReference(const QString &layerId, const QString &symbolLayerId)
Constructor.
QgsSymbolLayerReference()=default
Q_DECL_DEPRECATED QgsSymbolLayerReference(const QString &layerId, const QgsSymbolLayerId &symbolLayer)
Constructor.
Represents a vector layer which manages a vector based dataset.
QList< QgsSymbolLayerReference > QgsSymbolLayerReferenceList
CORE_EXPORT QString symbolLayerReferenceListToString(const QgsSymbolLayerReferenceList &)
Utility function to turn a QgsSymbolLayerReferenceList into a string.
CORE_EXPORT QgsSymbolLayerReferenceList stringToSymbolLayerReferenceList(const QString &)
Utility function to parse a string originated from symbolLayerReferenceListToString into a QgsSymbolL...
uint qHash(const QgsSymbolLayerId &id)