diff --git a/python/core/auto_generated/geometry/qgsrectangle.sip.in b/python/core/auto_generated/geometry/qgsrectangle.sip.in index 627508f9935..04122d80871 100644 --- a/python/core/auto_generated/geometry/qgsrectangle.sip.in +++ b/python/core/auto_generated/geometry/qgsrectangle.sip.in @@ -59,7 +59,6 @@ Copy constructor ~QgsRectangle(); - static QgsRectangle fromWkt( const QString &wkt ); %Docstring Creates a new rectangle from a ``wkt`` string. diff --git a/src/core/geometry/qgsgeometry.cpp b/src/core/geometry/qgsgeometry.cpp index d1f2d2161e8..99818919e05 100644 --- a/src/core/geometry/qgsgeometry.cpp +++ b/src/core/geometry/qgsgeometry.cpp @@ -1204,7 +1204,7 @@ QgsRectangle QgsGeometry::boundingBox() const { return d->geometry->boundingBox(); } - return QgsRectangle::createNull(); + return QgsRectangle(); } QgsBox3D QgsGeometry::boundingBox3D() const diff --git a/src/core/geometry/qgsrectangle.h b/src/core/geometry/qgsrectangle.h index b5666fefcdf..f78be34aa06 100644 --- a/src/core/geometry/qgsrectangle.h +++ b/src/core/geometry/qgsrectangle.h @@ -99,22 +99,6 @@ 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. diff --git a/tests/src/core/geometry/testqgsgeometry.cpp b/tests/src/core/geometry/testqgsgeometry.cpp index 45ab6f5a4db..4e9ef1887d7 100644 --- a/tests/src/core/geometry/testqgsgeometry.cpp +++ b/tests/src/core/geometry/testqgsgeometry.cpp @@ -837,7 +837,7 @@ void TestQgsGeometry::fromPolyline() void TestQgsGeometry::fromRect() { - QgsRectangle rectNull = QgsRectangle::createNull(); + QgsRectangle rectNull; QgsGeometry fromRect = QgsGeometry::fromRect( rectNull ); QVERIFY( fromRect.isNull() ); @@ -2183,7 +2183,7 @@ void TestQgsGeometry::orientedMinimumBoundingBox() void TestQgsGeometry::boundingBox() { QgsGeometry geomTest; - QgsRectangle nullRect = QgsRectangle::createNull(); + QgsRectangle nullRect; QCOMPARE( geomTest.boundingBox(), nullRect ); geomTest = QgsGeometry::fromWkt( QStringLiteral( "LINESTRING(-1 -2, 4 5)" ) ); diff --git a/tests/src/providers/testqgsvirtuallayerprovider.cpp b/tests/src/providers/testqgsvirtuallayerprovider.cpp index 5471e39b83a..561271a3fd9 100644 --- a/tests/src/providers/testqgsvirtuallayerprovider.cpp +++ b/tests/src/providers/testqgsvirtuallayerprovider.cpp @@ -83,7 +83,7 @@ void TestQgsVirtualLayerProvider::testConstructor() QString uri; std::unique_ptr prov( new QgsVirtualLayerProvider( uri, opts ) ); - const QgsRectangle rectNull = QgsRectangle::createNull(); + const QgsRectangle rectNull; QCOMPARE( prov->sourceExtent(), rectNull ); }