mirror of
https://github.com/qgis/QGIS.git
synced 2025-12-07 00:03:52 -05:00
[qml] Upgrade QgsRectangle to Q_GADGET
This commit is contained in:
parent
3ec4a8aab3
commit
cbef4f7172
@ -25,6 +25,9 @@ Examples are storing a layer extent or the current view extent of a map
|
|||||||
%TypeHeaderCode
|
%TypeHeaderCode
|
||||||
#include "qgsrectangle.h"
|
#include "qgsrectangle.h"
|
||||||
%End
|
%End
|
||||||
|
public:
|
||||||
|
static const QMetaObject staticMetaObject;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
QgsRectangle(); // optimised constructor for null rectangle - no need to call normalize here
|
QgsRectangle(); // optimised constructor for null rectangle - no need to call normalize here
|
||||||
|
|||||||
@ -58,6 +58,9 @@ A :py:class:`QgsRectangle` with associated coordinate reference system.
|
|||||||
%TypeHeaderCode
|
%TypeHeaderCode
|
||||||
#include "qgsreferencedgeometry.h"
|
#include "qgsreferencedgeometry.h"
|
||||||
%End
|
%End
|
||||||
|
public:
|
||||||
|
static const QMetaObject staticMetaObject;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
QgsReferencedRectangle( const QgsRectangle &rectangle, const QgsCoordinateReferenceSystem &crs );
|
QgsReferencedRectangle( const QgsRectangle &rectangle, const QgsCoordinateReferenceSystem &crs );
|
||||||
|
|||||||
@ -25,6 +25,9 @@ Examples are storing a layer extent or the current view extent of a map
|
|||||||
%TypeHeaderCode
|
%TypeHeaderCode
|
||||||
#include "qgsrectangle.h"
|
#include "qgsrectangle.h"
|
||||||
%End
|
%End
|
||||||
|
public:
|
||||||
|
static const QMetaObject staticMetaObject;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
QgsRectangle(); // optimised constructor for null rectangle - no need to call normalize here
|
QgsRectangle(); // optimised constructor for null rectangle - no need to call normalize here
|
||||||
|
|||||||
@ -58,6 +58,9 @@ A :py:class:`QgsRectangle` with associated coordinate reference system.
|
|||||||
%TypeHeaderCode
|
%TypeHeaderCode
|
||||||
#include "qgsreferencedgeometry.h"
|
#include "qgsreferencedgeometry.h"
|
||||||
%End
|
%End
|
||||||
|
public:
|
||||||
|
static const QMetaObject staticMetaObject;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
QgsReferencedRectangle( const QgsRectangle &rectangle, const QgsCoordinateReferenceSystem &crs );
|
QgsReferencedRectangle( const QgsRectangle &rectangle, const QgsCoordinateReferenceSystem &crs );
|
||||||
|
|||||||
@ -40,6 +40,20 @@ class QgsBox3D;
|
|||||||
*/
|
*/
|
||||||
class CORE_EXPORT QgsRectangle
|
class CORE_EXPORT QgsRectangle
|
||||||
{
|
{
|
||||||
|
Q_GADGET
|
||||||
|
|
||||||
|
Q_PROPERTY( double xMinimum READ xMinimum WRITE setXMinimum )
|
||||||
|
Q_PROPERTY( double xMaximum READ xMaximum WRITE setXMaximum )
|
||||||
|
Q_PROPERTY( double yMinimum READ yMinimum WRITE setYMinimum )
|
||||||
|
Q_PROPERTY( double yMaximum READ yMaximum WRITE setYMaximum )
|
||||||
|
Q_PROPERTY( double width READ width )
|
||||||
|
Q_PROPERTY( double height READ height )
|
||||||
|
Q_PROPERTY( double area READ area )
|
||||||
|
Q_PROPERTY( double perimeter READ perimeter )
|
||||||
|
Q_PROPERTY( QgsPointXY center READ center )
|
||||||
|
Q_PROPERTY( bool isEmpty READ isEmpty )
|
||||||
|
Q_PROPERTY( bool isNull READ isNull )
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//! Constructor for a null rectangle
|
//! Constructor for a null rectangle
|
||||||
@ -518,12 +532,12 @@ class CORE_EXPORT QgsRectangle
|
|||||||
/**
|
/**
|
||||||
* Returns a string representation of the rectangle in WKT format.
|
* Returns a string representation of the rectangle in WKT format.
|
||||||
*/
|
*/
|
||||||
QString asWktCoordinates() const;
|
Q_INVOKABLE QString asWktCoordinates() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a string representation of the rectangle as a WKT Polygon.
|
* Returns a string representation of the rectangle as a WKT Polygon.
|
||||||
*/
|
*/
|
||||||
QString asWktPolygon() const;
|
Q_INVOKABLE QString asWktPolygon() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a QRectF with same coordinates as the rectangle.
|
* Returns a QRectF with same coordinates as the rectangle.
|
||||||
@ -538,7 +552,7 @@ class CORE_EXPORT QgsRectangle
|
|||||||
* Coordinates will be truncated to the specified precision.
|
* Coordinates will be truncated to the specified precision.
|
||||||
* If the specified precision is less than 0, a suitable minimum precision is used.
|
* If the specified precision is less than 0, a suitable minimum precision is used.
|
||||||
*/
|
*/
|
||||||
QString toString( int precision = 16 ) const;
|
Q_INVOKABLE QString toString( int precision = 16 ) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the rectangle as a polygon.
|
* Returns the rectangle as a polygon.
|
||||||
|
|||||||
@ -16,6 +16,7 @@
|
|||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#include "qgsreferencedgeometry.h"
|
#include "qgsreferencedgeometry.h"
|
||||||
|
#include "moc_qgsreferencedgeometry.cpp"
|
||||||
|
|
||||||
QgsReferencedGeometryBase::QgsReferencedGeometryBase( const QgsCoordinateReferenceSystem &crs )
|
QgsReferencedGeometryBase::QgsReferencedGeometryBase( const QgsCoordinateReferenceSystem &crs )
|
||||||
: mCrs( crs )
|
: mCrs( crs )
|
||||||
|
|||||||
@ -70,6 +70,8 @@ class CORE_EXPORT QgsReferencedGeometryBase
|
|||||||
*/
|
*/
|
||||||
class CORE_EXPORT QgsReferencedRectangle : public QgsRectangle, public QgsReferencedGeometryBase
|
class CORE_EXPORT QgsReferencedRectangle : public QgsRectangle, public QgsReferencedGeometryBase
|
||||||
{
|
{
|
||||||
|
Q_GADGET
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user