mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-05 00:09:32 -04:00
205 lines
5.5 KiB
Plaintext
205 lines
5.5 KiB
Plaintext
/************************************************************************
|
|
* This file has been generated automatically from *
|
|
* *
|
|
* src/core/symbology/qgssymbollayerreference.h *
|
|
* *
|
|
* Do not edit manually ! Edit header and run scripts/sipify.py again *
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
class QgsSymbolLayerId
|
|
{
|
|
%Docstring(signature="appended")
|
|
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 :py:class:`QgsFeatureRenderer`)
|
|
- a path of indexes inside its symbol and subsymbols.
|
|
|
|
For a symbol in a :py:class:`QgsSingleSymbolRenderer` that has two
|
|
symbol layers, it will give:
|
|
|
|
- "" for the symbol key
|
|
- [0] and [1] for the two symbol layer indexes
|
|
|
|
For a :py:class:`QgsRuleBasedRenderer` each rule key is the symbol key.
|
|
|
|
For a symbol with a symbol layer that has a sub symbol (say a
|
|
:py:class:`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.
|
|
|
|
.. versionadded:: 3.12
|
|
|
|
.. deprecated:: 3.30
|
|
|
|
Replaced by QUuid to identify symbol layers.
|
|
%End
|
|
|
|
%TypeHeaderCode
|
|
#include "qgssymbollayerreference.h"
|
|
%End
|
|
public:
|
|
QgsSymbolLayerId();
|
|
|
|
QgsSymbolLayerId( const QString &key, int index );
|
|
%Docstring
|
|
QgsSymbolLayerId constructor with a symbol key and a unique symbol layer
|
|
index
|
|
%End
|
|
|
|
QgsSymbolLayerId( const QString &key, const QVector<int> &indexPath );
|
|
%Docstring
|
|
QgsSymbolLayerId constructor with a symbol key and an index path
|
|
%End
|
|
|
|
QgsSymbolLayerId( const QgsSymbolLayerId &other );
|
|
|
|
QString symbolKey() const;
|
|
%Docstring
|
|
Returns the key associated to the symbol
|
|
%End
|
|
|
|
QVector<int> symbolLayerIndexPath() const;
|
|
%Docstring
|
|
Returns the symbol layer index path inside the symbol
|
|
%End
|
|
|
|
|
|
bool operator==( const QgsSymbolLayerId &other ) const;
|
|
|
|
bool operator<( const QgsSymbolLayerId &other ) const;
|
|
|
|
SIP_PYOBJECT __repr__();
|
|
%MethodCode
|
|
|
|
QStringList pathString;
|
|
for ( int path : sipCpp->symbolLayerIndexPath() )
|
|
{
|
|
pathString.append( QString::number( path ) );
|
|
}
|
|
QString str = QStringLiteral( "<QgsSymbolLayerId: %1 (%2)>" ).arg( sipCpp->symbolKey(), pathString.join( ',' ) );
|
|
sipRes = PyUnicode_FromString( str.toUtf8().constData() );
|
|
%End
|
|
|
|
};
|
|
|
|
class QgsSymbolLayerReference
|
|
{
|
|
%Docstring(signature="appended")
|
|
Type used to refer to a specific symbol layer in a symbol of a layer.
|
|
|
|
.. versionadded:: 3.12
|
|
%End
|
|
|
|
%TypeHeaderCode
|
|
#include "qgssymbollayerreference.h"
|
|
%End
|
|
public:
|
|
|
|
QgsSymbolLayerReference();
|
|
|
|
QgsSymbolLayerReference( const QString &layerId, const QgsSymbolLayerId &symbolLayer ) /Deprecated="Since 3.30. "/;
|
|
%Docstring
|
|
Constructor
|
|
|
|
:param layerId: layer id
|
|
:param symbolLayer: symbol layer id
|
|
|
|
.. deprecated:: 3.30
|
|
%End
|
|
|
|
QgsSymbolLayerReference( const QString &layerId, const QString &symbolLayerId );
|
|
%Docstring
|
|
Constructor
|
|
|
|
:param layerId: layer id
|
|
:param symbolLayerId: symbol layer id
|
|
|
|
.. versionadded:: 3.30
|
|
%End
|
|
|
|
QString layerId() const;
|
|
%Docstring
|
|
The referenced vector layer / feature renderer
|
|
%End
|
|
|
|
QgsSymbolLayerId symbolLayerId() const /Deprecated="Since 3.30. Use symbolLayerIdV2() instead."/;
|
|
%Docstring
|
|
The symbol layer's id
|
|
|
|
.. deprecated:: 3.30
|
|
|
|
Use :py:func:`~QgsSymbolLayerReference.symbolLayerIdV2` instead.
|
|
%End
|
|
|
|
QString symbolLayerIdV2() const;
|
|
%Docstring
|
|
The symbol layer's id
|
|
|
|
.. versionadded:: 3.30
|
|
%End
|
|
|
|
bool operator==( const QgsSymbolLayerReference &other ) const;
|
|
|
|
SIP_PYOBJECT __repr__();
|
|
%MethodCode
|
|
|
|
QStringList pathString;
|
|
for ( int path : sipCpp->symbolLayerId().symbolLayerIndexPath() )
|
|
{
|
|
pathString.append( QString::number( path ) );
|
|
}
|
|
QString str = QStringLiteral( "<QgsSymbolLayerReference: %1 - %2>" ).arg( sipCpp->layerId(), sipCpp->symbolLayerIdV2() );
|
|
sipRes = PyUnicode_FromString( str.toUtf8().constData() );
|
|
%End
|
|
|
|
};
|
|
|
|
uint qHash( const QgsSymbolLayerId &id );
|
|
|
|
uint qHash( const QgsSymbolLayerReference &r );
|
|
|
|
typedef QList<QgsSymbolLayerReference> QgsSymbolLayerReferenceList;
|
|
|
|
QString symbolLayerReferenceListToString( const QgsSymbolLayerReferenceList & );
|
|
%Docstring
|
|
Utility function to turn a :py:class:`QgsSymbolLayerReferenceList` into
|
|
a string
|
|
|
|
.. seealso:: :py:func:`stringToSymbolLayerReferenceList`
|
|
|
|
.. versionadded:: 3.12
|
|
%End
|
|
|
|
QgsSymbolLayerReferenceList stringToSymbolLayerReferenceList( const QString & );
|
|
%Docstring
|
|
Utility function to parse a string originated from
|
|
symbolLayerReferenceListToString into a
|
|
:py:class:`QgsSymbolLayerReferenceList`
|
|
|
|
.. seealso:: :py:func:`symbolLayerReferenceListToString`
|
|
|
|
.. versionadded:: 3.12
|
|
%End
|
|
|
|
/************************************************************************
|
|
* This file has been generated automatically from *
|
|
* *
|
|
* src/core/symbology/qgssymbollayerreference.h *
|
|
* *
|
|
* Do not edit manually ! Edit header and run scripts/sipify.py again *
|
|
************************************************************************/
|