From 700a197df630cca5e4a89fd0d7d3cf7c14e34a7b Mon Sep 17 00:00:00 2001 From: Mathieu Pellerin Date: Fri, 22 Nov 2024 09:17:09 +0700 Subject: [PATCH] [qml] Expose QgsLocatorContext's transformContext as property --- .../auto_generated/proj/qgscoordinatetransformcontext.sip.in | 1 + .../auto_generated/proj/qgscoordinatetransformcontext.sip.in | 1 + src/core/geometry/qgsrectangle.cpp | 1 + src/core/locator/qgslocatorcontext.h | 1 + src/core/proj/qgscoordinatetransformcontext.cpp | 5 +++++ src/core/proj/qgscoordinatetransformcontext.h | 3 ++- 6 files changed, 11 insertions(+), 1 deletion(-) diff --git a/python/PyQt6/core/auto_generated/proj/qgscoordinatetransformcontext.sip.in b/python/PyQt6/core/auto_generated/proj/qgscoordinatetransformcontext.sip.in index 4c0103c2d7d1..ab46415bc187 100644 --- a/python/PyQt6/core/auto_generated/proj/qgscoordinatetransformcontext.sip.in +++ b/python/PyQt6/core/auto_generated/proj/qgscoordinatetransformcontext.sip.in @@ -49,6 +49,7 @@ Constructor for QgsCoordinateTransformContext. QgsCoordinateTransformContext( const QgsCoordinateTransformContext &rhs ); bool operator==( const QgsCoordinateTransformContext &rhs ) const; + bool operator!=( const QgsCoordinateTransformContext &rhs ) const; void clear(); %Docstring diff --git a/python/core/auto_generated/proj/qgscoordinatetransformcontext.sip.in b/python/core/auto_generated/proj/qgscoordinatetransformcontext.sip.in index 4c0103c2d7d1..ab46415bc187 100644 --- a/python/core/auto_generated/proj/qgscoordinatetransformcontext.sip.in +++ b/python/core/auto_generated/proj/qgscoordinatetransformcontext.sip.in @@ -49,6 +49,7 @@ Constructor for QgsCoordinateTransformContext. QgsCoordinateTransformContext( const QgsCoordinateTransformContext &rhs ); bool operator==( const QgsCoordinateTransformContext &rhs ) const; + bool operator!=( const QgsCoordinateTransformContext &rhs ) const; void clear(); %Docstring diff --git a/src/core/geometry/qgsrectangle.cpp b/src/core/geometry/qgsrectangle.cpp index 37fbb9e89478..b3a18e6ea342 100644 --- a/src/core/geometry/qgsrectangle.cpp +++ b/src/core/geometry/qgsrectangle.cpp @@ -22,6 +22,7 @@ #include "qgsbox3d.h" #include "qgspolygon.h" #include "qgslinestring.h" +#include "moc_qgsrectangle.cpp" #include #include diff --git a/src/core/locator/qgslocatorcontext.h b/src/core/locator/qgslocatorcontext.h index 325e6cc1be2b..70934a7a59dc 100644 --- a/src/core/locator/qgslocatorcontext.h +++ b/src/core/locator/qgslocatorcontext.h @@ -34,6 +34,7 @@ class CORE_EXPORT QgsLocatorContext Q_PROPERTY( QgsRectangle targetExtent MEMBER targetExtent ) Q_PROPERTY( QgsCoordinateReferenceSystem targetExtentCrs MEMBER targetExtentCrs ) + Q_PROPERTY( QgsCoordinateTransformContext transformContext MEMBER transformContext ) Q_PROPERTY( bool usingPrefix MEMBER usingPrefix ) public: diff --git a/src/core/proj/qgscoordinatetransformcontext.cpp b/src/core/proj/qgscoordinatetransformcontext.cpp index f61b40792044..4a4dfc8eea6e 100644 --- a/src/core/proj/qgscoordinatetransformcontext.cpp +++ b/src/core/proj/qgscoordinatetransformcontext.cpp @@ -65,6 +65,11 @@ bool QgsCoordinateTransformContext::operator==( const QgsCoordinateTransformCont return equal; } +bool QgsCoordinateTransformContext::operator!=( const QgsCoordinateTransformContext &rhs ) const +{ + return !( *this == rhs ); +} + void QgsCoordinateTransformContext::clear() { d.detach(); diff --git a/src/core/proj/qgscoordinatetransformcontext.h b/src/core/proj/qgscoordinatetransformcontext.h index 7f62c7b6e1b6..7779a0e0366a 100644 --- a/src/core/proj/qgscoordinatetransformcontext.h +++ b/src/core/proj/qgscoordinatetransformcontext.h @@ -67,7 +67,8 @@ class CORE_EXPORT QgsCoordinateTransformContext QgsCoordinateTransformContext( const QgsCoordinateTransformContext &rhs ); QgsCoordinateTransformContext &operator=( const QgsCoordinateTransformContext &rhs ) SIP_SKIP; - bool operator==( const QgsCoordinateTransformContext &rhs ) const ; + bool operator==( const QgsCoordinateTransformContext &rhs ) const; + bool operator!=( const QgsCoordinateTransformContext &rhs ) const; /** * Clears all stored transform information from the context.