Skip to content

Commit

Permalink
Add a QgsRectangle::createNull() temporary static method
Browse files Browse the repository at this point in the history
  • Loading branch information
strk authored and nyalldawson committed Oct 21, 2023
1 parent fc3e395 commit 1df4c52
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions python/core/auto_generated/geometry/qgsrectangle.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ Copy constructor

~QgsRectangle();


static QgsRectangle fromWkt( const QString &wkt );
%Docstring
Creates a new rectangle from a ``wkt`` string.
Expand Down
16 changes: 16 additions & 0 deletions src/core/geometry/qgsrectangle.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,22 @@ class CORE_EXPORT QgsRectangle
// see https://github.com/qgis/QGIS/pull/4720#issuecomment-308652392
~QgsRectangle() = default;

/**
* Creates a null rectangle.
*
* This is a temporary method to use while the default
* constructor is still not constructing a null rectangle.
*
* \since QGIS 3.34
*/
static QgsRectangle createNull() SIP_SKIP
{
// TODO: remove this method once the default constructor gives a null
QgsRectangle rectNull;
rectNull.setNull(); // TODO: have setNull() return *this ?
return rectNull;
}

/**
* Creates a new rectangle from a \a wkt string.
* The WKT must contain only 5 vertices, representing a rectangle aligned with X and Y axes.
Expand Down

0 comments on commit 1df4c52

Please sign in to comment.