16#ifndef QGSSYMBOLLAYERREFERENCE_H
17#define QGSSYMBOLLAYERREFERENCE_H
66 : mSymbolKey( key ), mIndexPath( { index } )
73 : mSymbolKey( key ), mIndexPath( { indexPath } )
97 return ( mSymbolKey == other.mSymbolKey && mIndexPath == other.mIndexPath );
103 return ( mSymbolKey == other.mSymbolKey ) ?
104 mIndexPath < other.mIndexPath
105 : mSymbolKey < other.mSymbolKey;
109 SIP_PYOBJECT __repr__();
112 QStringList pathString;
113 for (
int path : sipCpp->symbolLayerIndexPath() )
115 pathString.append( QString::number( path ) );
117 QString
str = QStringLiteral(
"<QgsSymbolLayerId: %1 (%2)>" ).arg( sipCpp->symbolKey(), pathString.join(
',' ) );
118 sipRes = PyUnicode_FromString(
str.toUtf8().constData() );
127 QVector<int> mIndexPath;
150 : mLayerId( layerId ), mDeprecatedSymbolLayerId( symbolLayer )
160 : mLayerId( layerId ), mSymbolLayerId( symbolLayerId )
183 return mLayerId == other.mLayerId
184 && mSymbolLayerId == other.mSymbolLayerId
185 && mDeprecatedSymbolLayerId == other.mDeprecatedSymbolLayerId;
189 SIP_PYOBJECT __repr__();
192 QStringList pathString;
193 for (
int path : sipCpp->symbolLayerId().symbolLayerIndexPath() )
195 pathString.append( QString::number( path ) );
197 QString
str = QStringLiteral(
"<QgsSymbolLayerReference: %1 - %2>" ).arg( sipCpp->layerId(), sipCpp->symbolLayerIdV2() );
198 sipRes = PyUnicode_FromString(
str.toUtf8().constData() );
208 QString mSymbolLayerId;
213 return qHash(
id.symbolKey() ) ^
qHash(
id.symbolLayerIndexPath() );
We may need stable references to symbol layers, when pointers to symbol layers is 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
Default assignment operator.
bool operator==(const QgsSymbolLayerId &other) const
Equality operator.
QVector< int > symbolLayerIndexPath() const
Returns the symbol layer index path inside the symbol.
QgsSymbolLayerId(const QgsSymbolLayerId &other)=default
Default copy constructor.
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
Comparison operator.
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
Default constructor.
Q_DECL_DEPRECATED QgsSymbolLayerReference(const QString &layerId, const QgsSymbolLayerId &symbolLayer)
Constructor.
Represents a vector layer which manages a vector based data sets.
Q_DECL_DEPRECATED uint qHash(const QgsSymbolLayerId &id)
QList< QgsSymbolLayerReference > QgsSymbolLayerReferenceList
CORE_EXPORT QString symbolLayerReferenceListToString(const QgsSymbolLayerReferenceList &)
Utilitary function to turn a QgsSymbolLayerReferenceList into a string.
CORE_EXPORT QgsSymbolLayerReferenceList stringToSymbolLayerReferenceList(const QString &)
Utilitary function to parse a string originated from symbolLayerReferenceListToString into a QgsSymbo...