24 QStringList indexPathStr;
25 for (
int index : ref.symbolLayerId().symbolLayerIndexPath() )
27 indexPathStr.append( QString::number( index ) );
29 slst.append( QStringLiteral(
"%1,%2,%3" ).arg( ref.layerId(), ref.symbolLayerId().symbolKey(), indexPathStr.join(
',' ) ) );
31 return slst.join(
';' );
38 const QStringList split = str.split(
';' );
39 for ( QString tuple : split )
42 QStringList elements = tuple.split(
',' );
43 if ( elements.size() >= 3 )
45 QVector<int> indexPath;
46 for (
int i = 2; i < elements.size(); i++ )
48 indexPath.append( elements[i].toInt() );
We may need stable references to symbol layers, when pointers to symbol layers is not usable (when a ...
Type used to refer to a specific symbol layer in a symbol of a layer.
QString symbolLayerReferenceListToString(const QgsSymbolLayerReferenceList &lst)
Utilitary function to turn a QgsSymbolLayerReferenceList into a string.
QgsSymbolLayerReferenceList stringToSymbolLayerReferenceList(const QString &str)
Utilitary function to parse a string originated from symbolLayerReferenceListToString into a QgsSymbo...
QList< QgsSymbolLayerReference > QgsSymbolLayerReferenceList