Skip to content
Permalink
Browse files
Add a __repr__ for QgsLabelPosition
  • Loading branch information
nyalldawson committed Jun 9, 2021
1 parent 8466988 commit 8bfb959e295bfeef00a9c8a75a51850ddf511706
@@ -48,6 +48,13 @@ Constructor for QgsLabelPosition.
Constructor for QgsLabelPosition
%End

SIP_PYOBJECT __repr__();
%MethodCode
const QString text = sipCpp->labelText;
QString str = QStringLiteral( "<QgsLabelPosition: \"%1\"%2>" ).arg( text, sipCpp->isUnplaced ? QStringLiteral( " (unplaced)" ) : QString() );
sipRes = PyUnicode_FromString( str.toUtf8().constData() );
%End

QgsFeatureId featureId;

double rotation;
@@ -74,6 +74,15 @@ class CORE_EXPORT QgsLabelPosition
//! Constructor for QgsLabelPosition
QgsLabelPosition() = default;

#ifdef SIP_RUN
SIP_PYOBJECT __repr__();
% MethodCode
const QString text = sipCpp->labelText;
QString str = QStringLiteral( "<QgsLabelPosition: \"%1\"%2>" ).arg( text, sipCpp->isUnplaced ? QStringLiteral( " (unplaced)" ) : QString() );
sipRes = PyUnicode_FromString( str.toUtf8().constData() );
% End
#endif

/**
* ID of feature associated with this label.
*/

0 comments on commit 8bfb959

Please sign in to comment.