add Python __repr__ method to QgsGeometry.Error (#8198)

This commit is contained in:
Denis Rouzaud 2018-10-15 06:53:09 -08:00 committed by GitHub
parent 440d8d854c
commit 32d4bcc425
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 0 deletions

View File

@ -1497,6 +1497,12 @@ The coordinates at which the error is located and should be visualized.
True if the location available from :py:func:`where` is valid.
%End
SIP_PYOBJECT __repr__();
%MethodCode
QString str = QStringLiteral( "<QgsGeometry.Error: %1>" ).arg( sipCpp->what() );
sipRes = PyUnicode_FromString( str.toUtf8().data() );
%End
};
enum ValidationMethod

View File

@ -1449,6 +1449,14 @@ class CORE_EXPORT QgsGeometry
*/
bool hasWhere() const;
#ifdef SIP_RUN
SIP_PYOBJECT __repr__();
% MethodCode
QString str = QStringLiteral( "<QgsGeometry.Error: %1>" ).arg( sipCpp->what() );
sipRes = PyUnicode_FromString( str.toUtf8().data() );
% End
#endif
private:
QString mMessage;
QgsPointXY mLocation;