From 7d31cc1dab00dd44ad859a238cf02f08eb07aa30 Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Wed, 1 Oct 2025 14:40:55 +1000 Subject: [PATCH] Run code_cleanup script --- src/3d/qgs3dutils.cpp | 2 +- .../processing/pdal/qgspdalalgorithmbase.cpp | 2 +- .../qgsalgorithmcheckgeometryangle.cpp | 2 +- .../qgsalgorithmcheckgeometryarea.cpp | 2 +- .../qgsalgorithmcheckgeometrycontained.cpp | 2 +- .../qgsalgorithmcheckgeometrydangle.cpp | 2 +- ...lgorithmcheckgeometrydegeneratepolygon.cpp | 2 +- .../qgsalgorithmcheckgeometryduplicate.cpp | 2 +- ...gsalgorithmcheckgeometryduplicatenodes.cpp | 2 +- ...algorithmcheckgeometryfollowboundaries.cpp | 2 +- .../qgsalgorithmcheckgeometrygap.cpp | 2 +- .../qgsalgorithmcheckgeometryhole.cpp | 2 +- ...algorithmcheckgeometrylineintersection.cpp | 2 +- ...ithmcheckgeometrylinelayerintersection.cpp | 2 +- ...qgsalgorithmcheckgeometrymissingvertex.cpp | 2 +- .../qgsalgorithmcheckgeometrymultipart.cpp | 2 +- .../qgsalgorithmcheckgeometryoverlap.cpp | 2 +- ...gorithmcheckgeometrypointcoveredbyline.cpp | 2 +- ...gsalgorithmcheckgeometrypointinpolygon.cpp | 2 +- ...qgsalgorithmcheckgeometrysegmentlength.cpp | 2 +- .../qgsalgorithmcheckgeometryselfcontact.cpp | 2 +- ...algorithmcheckgeometryselfintersection.cpp | 2 +- ...qgsalgorithmcheckgeometrysliverpolygon.cpp | 2 +- src/analysis/processing/qgsalgorithmclimb.cpp | 4 +- .../qgsalgorithmfixgeometryangle.cpp | 2 +- .../qgsalgorithmfixgeometryarea.cpp | 2 +- .../qgsalgorithmfixgeometryduplicatenodes.cpp | 2 +- .../processing/qgsalgorithmfixgeometrygap.cpp | 2 +- .../qgsalgorithmfixgeometryhole.cpp | 2 +- .../qgsalgorithmfixgeometrymissingvertex.cpp | 2 +- .../qgsalgorithmfixgeometrymultipart.cpp | 2 +- .../qgsalgorithmfixgeometryoverlap.cpp | 2 +- ...gsalgorithmfixgeometryselfintersection.cpp | 2 +- .../qgsalgorithmremovepartsbyarea.cpp | 2 +- .../qgsalgorithmremovepartsbylength.cpp | 2 +- .../gui/qgsauthplanetarycomputeredit.cpp | 2 +- src/core/geometry/qgsgeometry.cpp | 6 +-- .../layout/qgslayoutitemelevationprofile.cpp | 4 +- src/core/pal/problem.cpp | 2 +- .../plot/qgsvectorlayerplotdatagatherer.cpp | 2 +- src/core/project/qgsproject.cpp | 8 ++-- src/core/project/qgsprojectproperty.cpp | 2 +- src/core/qgscommandlineutils.cpp | 2 +- src/core/qgsogrutils.cpp | 12 ++--- src/core/symbology/qgsmarkersymbollayer.cpp | 4 +- src/core/vector/qgsvectorlayer.cpp | 4 +- src/core/vectortile/qgsvectortileutils.cpp | 2 +- .../qgselevationprofilelayertreeview.cpp | 2 +- .../qgslayoutelevationprofilewidget.cpp | 2 +- src/gui/plot/qgsplotwidget.cpp | 4 +- src/gui/qgsshortcutsmanager.cpp | 4 +- src/gui/vector/qgsattributesformmodel.cpp | 4 +- .../vector/qgsattributesformproperties.cpp | 4 +- src/providers/mssql/qgsmssqlprovider.cpp | 2 +- .../postgres/qgspostgresprovider.cpp | 6 +-- .../qgspostgresproviderconnection.cpp | 2 +- src/providers/wfs/qgswfsprovider.cpp | 2 +- src/providers/wfs/qgswfsprovidermetadata.cpp | 2 +- src/server/services/wfs3/qgswfs3.cpp | 2 +- tests/src/analysis/testqgsninecellfilters.cpp | 2 +- .../testqgsprocessingcheckgeometry.cpp | 36 +++++++-------- .../analysis/testqgsprocessingfixgeometry.cpp | 2 +- .../src/analysis/testqgsrastercalculator.cpp | 2 +- tests/src/core/geometry/testqgssfcgal.cpp | 46 +++++++++---------- tests/src/core/testqgsgdalutils.cpp | 2 +- tests/src/core/testqgslayertree.cpp | 2 +- tests/src/gui/testqgsattributeform.cpp | 2 +- tests/src/gui/testqgsattributesformmodel.cpp | 10 ++-- tests/src/gui/testqgsscalecombobox.cpp | 2 +- 69 files changed, 132 insertions(+), 132 deletions(-) diff --git a/src/3d/qgs3dutils.cpp b/src/3d/qgs3dutils.cpp index eebe137e11c..6f9a21a035b 100644 --- a/src/3d/qgs3dutils.cpp +++ b/src/3d/qgs3dutils.cpp @@ -1161,7 +1161,7 @@ QgsCameraPose Qgs3DUtils::lineSegmentToCameraPose( const QgsVector3D &startPoint std::unique_ptr Qgs3DUtils::copyCamera( Qt3DRender::QCamera *cam ) { - std::unique_ptr copy = std::make_unique(); + auto copy = std::make_unique(); copy->setPosition( cam->position() ); copy->setViewCenter( cam->viewCenter() ); copy->setUpVector( cam->upVector() ); diff --git a/src/analysis/processing/pdal/qgspdalalgorithmbase.cpp b/src/analysis/processing/pdal/qgspdalalgorithmbase.cpp index 4d66dcd3ce4..86d7ede4e92 100644 --- a/src/analysis/processing/pdal/qgspdalalgorithmbase.cpp +++ b/src/analysis/processing/pdal/qgspdalalgorithmbase.cpp @@ -296,7 +296,7 @@ QgsPointCloudLayer *QgsPdalAlgorithmBase::parameterAsPointCloudLayer( const QVar return nullptr; // if COPC provider, return as it is - if ( layer->dataProvider()->name() == QStringLiteral( "copc" ) ) + if ( layer->dataProvider()->name() == QLatin1String( "copc" ) ) { return layer; } diff --git a/src/analysis/processing/qgsalgorithmcheckgeometryangle.cpp b/src/analysis/processing/qgsalgorithmcheckgeometryangle.cpp index 4ce490746a7..cbcae5d12ca 100644 --- a/src/analysis/processing/qgsalgorithmcheckgeometryangle.cpp +++ b/src/analysis/processing/qgsalgorithmcheckgeometryangle.cpp @@ -94,7 +94,7 @@ void QgsGeometryCheckAngleAlgorithm::initAlgorithm( const QVariantMap &configura QStringLiteral( "ERRORS" ), QObject::tr( "Small angle errors" ), Qgis::ProcessingSourceType::VectorPoint ) ); - std::unique_ptr tolerance = std::make_unique( + auto tolerance = std::make_unique( QStringLiteral( "TOLERANCE" ), QObject::tr( "Tolerance" ), Qgis::ProcessingNumberParameterType::Integer, 8, false, 1, 13 ); tolerance->setFlags( tolerance->flags() | Qgis::ProcessingParameterFlag::Advanced ); diff --git a/src/analysis/processing/qgsalgorithmcheckgeometryarea.cpp b/src/analysis/processing/qgsalgorithmcheckgeometryarea.cpp index 95234d285f8..d458f610452 100644 --- a/src/analysis/processing/qgsalgorithmcheckgeometryarea.cpp +++ b/src/analysis/processing/qgsalgorithmcheckgeometryarea.cpp @@ -97,7 +97,7 @@ void QgsGeometryCheckAreaAlgorithm::initAlgorithm( const QVariantMap &configurat QStringLiteral( "OUTPUT" ), QObject::tr( "Small polygons features" ), Qgis::ProcessingSourceType::VectorPolygon, QVariant(), true, false ) ); - std::unique_ptr tolerance = std::make_unique( + auto tolerance = std::make_unique( QStringLiteral( "TOLERANCE" ), QObject::tr( "Tolerance" ), Qgis::ProcessingNumberParameterType::Integer, 8, false, 1, 13 ); tolerance->setFlags( tolerance->flags() | Qgis::ProcessingParameterFlag::Advanced ); diff --git a/src/analysis/processing/qgsalgorithmcheckgeometrycontained.cpp b/src/analysis/processing/qgsalgorithmcheckgeometrycontained.cpp index 11f0d405b98..86eebce577a 100644 --- a/src/analysis/processing/qgsalgorithmcheckgeometrycontained.cpp +++ b/src/analysis/processing/qgsalgorithmcheckgeometrycontained.cpp @@ -98,7 +98,7 @@ void QgsGeometryCheckContainedAlgorithm::initAlgorithm( const QVariantMap &confi QStringLiteral( "OUTPUT" ), QObject::tr( "Contained features" ), Qgis::ProcessingSourceType::VectorAnyGeometry, QVariant(), true, false ) ); - std::unique_ptr tolerance = std::make_unique( + auto tolerance = std::make_unique( QStringLiteral( "TOLERANCE" ), QObject::tr( "Tolerance" ), Qgis::ProcessingNumberParameterType::Integer, 8, false, 1, 13 ); diff --git a/src/analysis/processing/qgsalgorithmcheckgeometrydangle.cpp b/src/analysis/processing/qgsalgorithmcheckgeometrydangle.cpp index 196f9b9c230..5b8837493b3 100644 --- a/src/analysis/processing/qgsalgorithmcheckgeometrydangle.cpp +++ b/src/analysis/processing/qgsalgorithmcheckgeometrydangle.cpp @@ -88,7 +88,7 @@ void QgsGeometryCheckDangleAlgorithm::initAlgorithm( const QVariantMap &configur QStringLiteral( "OUTPUT" ), QObject::tr( "Dangle-end features" ), Qgis::ProcessingSourceType::VectorLine, QVariant(), true, false ) ); - std::unique_ptr tolerance = std::make_unique( + auto tolerance = std::make_unique( QStringLiteral( "TOLERANCE" ), QObject::tr( "Tolerance" ), Qgis::ProcessingNumberParameterType::Integer, 8, false, 1, 13 ); tolerance->setFlags( tolerance->flags() | Qgis::ProcessingParameterFlag::Advanced ); diff --git a/src/analysis/processing/qgsalgorithmcheckgeometrydegeneratepolygon.cpp b/src/analysis/processing/qgsalgorithmcheckgeometrydegeneratepolygon.cpp index 07db24a07b0..d4f213ebd9d 100644 --- a/src/analysis/processing/qgsalgorithmcheckgeometrydegeneratepolygon.cpp +++ b/src/analysis/processing/qgsalgorithmcheckgeometrydegeneratepolygon.cpp @@ -87,7 +87,7 @@ void QgsGeometryCheckDegeneratePolygonAlgorithm::initAlgorithm( const QVariantMa QStringLiteral( "OUTPUT" ), QObject::tr( "Degenerate polygons features" ), Qgis::ProcessingSourceType::VectorPolygon, QVariant(), true, false ) ); - std::unique_ptr tolerance = std::make_unique( QStringLiteral( "TOLERANCE" ), QObject::tr( "Tolerance" ), Qgis::ProcessingNumberParameterType::Integer, 8, false, 1, 13 ); + auto tolerance = std::make_unique( QStringLiteral( "TOLERANCE" ), QObject::tr( "Tolerance" ), Qgis::ProcessingNumberParameterType::Integer, 8, false, 1, 13 ); tolerance->setFlags( tolerance->flags() | Qgis::ProcessingParameterFlag::Advanced ); tolerance->setHelp( QObject::tr( "The \"Tolerance\" advanced parameter defines the numerical precision of geometric operations, " "given as an integer n, meaning that any difference smaller than 10⁻ⁿ (in map units) is considered zero." ) ); diff --git a/src/analysis/processing/qgsalgorithmcheckgeometryduplicate.cpp b/src/analysis/processing/qgsalgorithmcheckgeometryduplicate.cpp index e62ad15ddca..4117d553aed 100644 --- a/src/analysis/processing/qgsalgorithmcheckgeometryduplicate.cpp +++ b/src/analysis/processing/qgsalgorithmcheckgeometryduplicate.cpp @@ -94,7 +94,7 @@ void QgsGeometryCheckDuplicateAlgorithm::initAlgorithm( const QVariantMap &confi QStringLiteral( "OUTPUT" ), QObject::tr( "Duplicate geometries" ), Qgis::ProcessingSourceType::VectorAnyGeometry, QVariant(), true, false ) ); - std::unique_ptr tolerance = std::make_unique( + auto tolerance = std::make_unique( QStringLiteral( "TOLERANCE" ), QObject::tr( "Tolerance" ), Qgis::ProcessingNumberParameterType::Integer, 8, false, 1, 13 ); tolerance->setFlags( tolerance->flags() | Qgis::ProcessingParameterFlag::Advanced ); diff --git a/src/analysis/processing/qgsalgorithmcheckgeometryduplicatenodes.cpp b/src/analysis/processing/qgsalgorithmcheckgeometryduplicatenodes.cpp index 7933c53b5b0..e20dde05bc0 100644 --- a/src/analysis/processing/qgsalgorithmcheckgeometryduplicatenodes.cpp +++ b/src/analysis/processing/qgsalgorithmcheckgeometryduplicatenodes.cpp @@ -89,7 +89,7 @@ void QgsGeometryCheckDuplicateNodesAlgorithm::initAlgorithm( const QVariantMap & QStringLiteral( "OUTPUT" ), QObject::tr( "Duplicated vertices features" ), Qgis::ProcessingSourceType::VectorAnyGeometry, QVariant(), true, false ) ); - std::unique_ptr tolerance = std::make_unique( + auto tolerance = std::make_unique( QStringLiteral( "TOLERANCE" ), QObject::tr( "Tolerance" ), Qgis::ProcessingNumberParameterType::Integer, 8, false, 1, 13 ); tolerance->setFlags( tolerance->flags() | Qgis::ProcessingParameterFlag::Advanced ); diff --git a/src/analysis/processing/qgsalgorithmcheckgeometryfollowboundaries.cpp b/src/analysis/processing/qgsalgorithmcheckgeometryfollowboundaries.cpp index d3e60dda8d9..438d343f196 100644 --- a/src/analysis/processing/qgsalgorithmcheckgeometryfollowboundaries.cpp +++ b/src/analysis/processing/qgsalgorithmcheckgeometryfollowboundaries.cpp @@ -92,7 +92,7 @@ void QgsGeometryCheckFollowBoundariesAlgorithm::initAlgorithm( const QVariantMap QStringLiteral( "REF_LAYER" ), QObject::tr( "Reference layer" ), QList() << static_cast( Qgis::ProcessingSourceType::VectorPolygon ) ) ); - std::unique_ptr tolerance = std::make_unique( + auto tolerance = std::make_unique( QStringLiteral( "TOLERANCE" ), QObject::tr( "Tolerance" ), Qgis::ProcessingNumberParameterType::Integer, 8, false, 1, 13 ); tolerance->setFlags( tolerance->flags() | Qgis::ProcessingParameterFlag::Advanced ); diff --git a/src/analysis/processing/qgsalgorithmcheckgeometrygap.cpp b/src/analysis/processing/qgsalgorithmcheckgeometrygap.cpp index f53dea17a53..2da8d857b3d 100644 --- a/src/analysis/processing/qgsalgorithmcheckgeometrygap.cpp +++ b/src/analysis/processing/qgsalgorithmcheckgeometrygap.cpp @@ -108,7 +108,7 @@ void QgsGeometryCheckGapAlgorithm::initAlgorithm( const QVariantMap &configurati QStringLiteral( "OUTPUT" ), QObject::tr( "Gap features" ), Qgis::ProcessingSourceType::VectorPolygon ) ); - std::unique_ptr tolerance = std::make_unique( + auto tolerance = std::make_unique( QStringLiteral( "TOLERANCE" ), QObject::tr( "Tolerance" ), Qgis::ProcessingNumberParameterType::Integer, 8, false, 1, 13 ); tolerance->setFlags( tolerance->flags() | Qgis::ProcessingParameterFlag::Advanced ); diff --git a/src/analysis/processing/qgsalgorithmcheckgeometryhole.cpp b/src/analysis/processing/qgsalgorithmcheckgeometryhole.cpp index 8119fd952a9..7f60bc25d16 100644 --- a/src/analysis/processing/qgsalgorithmcheckgeometryhole.cpp +++ b/src/analysis/processing/qgsalgorithmcheckgeometryhole.cpp @@ -94,7 +94,7 @@ void QgsGeometryCheckHoleAlgorithm::initAlgorithm( const QVariantMap &configurat QStringLiteral( "OUTPUT" ), QObject::tr( "Polygons with holes" ), Qgis::ProcessingSourceType::VectorPolygon, QVariant(), true, false ) ); - std::unique_ptr tolerance = std::make_unique( + auto tolerance = std::make_unique( QStringLiteral( "TOLERANCE" ), QObject::tr( "Tolerance" ), Qgis::ProcessingNumberParameterType::Integer, 8, false, 1, 13 ); tolerance->setFlags( tolerance->flags() | Qgis::ProcessingParameterFlag::Advanced ); diff --git a/src/analysis/processing/qgsalgorithmcheckgeometrylineintersection.cpp b/src/analysis/processing/qgsalgorithmcheckgeometrylineintersection.cpp index 72769384fcf..9ad090dcc13 100644 --- a/src/analysis/processing/qgsalgorithmcheckgeometrylineintersection.cpp +++ b/src/analysis/processing/qgsalgorithmcheckgeometrylineintersection.cpp @@ -88,7 +88,7 @@ void QgsGeometryCheckLineIntersectionAlgorithm::initAlgorithm( const QVariantMap QStringLiteral( "OUTPUT" ), QObject::tr( "Intersecting feature" ), Qgis::ProcessingSourceType::VectorAnyGeometry, QVariant(), true, false ) ); - std::unique_ptr tolerance = std::make_unique( + auto tolerance = std::make_unique( QStringLiteral( "TOLERANCE" ), QObject::tr( "Tolerance" ), Qgis::ProcessingNumberParameterType::Integer, 8, false, 1, 13 ); tolerance->setFlags( tolerance->flags() | Qgis::ProcessingParameterFlag::Advanced ); diff --git a/src/analysis/processing/qgsalgorithmcheckgeometrylinelayerintersection.cpp b/src/analysis/processing/qgsalgorithmcheckgeometrylinelayerintersection.cpp index 35effdb023b..f3121aa4e85 100644 --- a/src/analysis/processing/qgsalgorithmcheckgeometrylinelayerintersection.cpp +++ b/src/analysis/processing/qgsalgorithmcheckgeometrylinelayerintersection.cpp @@ -94,7 +94,7 @@ void QgsGeometryCheckLineLayerIntersectionAlgorithm::initAlgorithm( const QVaria QStringLiteral( "OUTPUT" ), QObject::tr( "Line intersecting other layer features" ), Qgis::ProcessingSourceType::VectorAnyGeometry, QVariant(), true, false ) ); - std::unique_ptr tolerance = std::make_unique( + auto tolerance = std::make_unique( QStringLiteral( "TOLERANCE" ), QObject::tr( "Tolerance" ), Qgis::ProcessingNumberParameterType::Integer, 8, false, 1, 13 ); tolerance->setFlags( tolerance->flags() | Qgis::ProcessingParameterFlag::Advanced ); diff --git a/src/analysis/processing/qgsalgorithmcheckgeometrymissingvertex.cpp b/src/analysis/processing/qgsalgorithmcheckgeometrymissingvertex.cpp index 6cee8ff70ae..2f8b732945e 100644 --- a/src/analysis/processing/qgsalgorithmcheckgeometrymissingvertex.cpp +++ b/src/analysis/processing/qgsalgorithmcheckgeometrymissingvertex.cpp @@ -95,7 +95,7 @@ void QgsGeometryCheckMissingVertexAlgorithm::initAlgorithm( const QVariantMap &c QStringLiteral( "OUTPUT" ), QObject::tr( "Missing vertices features" ), Qgis::ProcessingSourceType::VectorPolygon, QVariant(), true, false ) ); - std::unique_ptr tolerance = std::make_unique( + auto tolerance = std::make_unique( QStringLiteral( "TOLERANCE" ), QObject::tr( "Tolerance" ), Qgis::ProcessingNumberParameterType::Integer, 8, false, 1, 13 ); tolerance->setFlags( tolerance->flags() | Qgis::ProcessingParameterFlag::Advanced ); diff --git a/src/analysis/processing/qgsalgorithmcheckgeometrymultipart.cpp b/src/analysis/processing/qgsalgorithmcheckgeometrymultipart.cpp index 16dbd03c0d7..f6da6fb6153 100644 --- a/src/analysis/processing/qgsalgorithmcheckgeometrymultipart.cpp +++ b/src/analysis/processing/qgsalgorithmcheckgeometrymultipart.cpp @@ -93,7 +93,7 @@ void QgsGeometryCheckMultipartAlgorithm::initAlgorithm( const QVariantMap &confi QStringLiteral( "OUTPUT" ), QObject::tr( "One-part geometry features" ), Qgis::ProcessingSourceType::VectorAnyGeometry, QVariant(), true, false ) ); - std::unique_ptr tolerance = std::make_unique( + auto tolerance = std::make_unique( QStringLiteral( "TOLERANCE" ), QObject::tr( "Tolerance" ), Qgis::ProcessingNumberParameterType::Integer, 8, false, 1, 13 ); tolerance->setFlags( tolerance->flags() | Qgis::ProcessingParameterFlag::Advanced ); diff --git a/src/analysis/processing/qgsalgorithmcheckgeometryoverlap.cpp b/src/analysis/processing/qgsalgorithmcheckgeometryoverlap.cpp index 9f334442843..060672feba5 100644 --- a/src/analysis/processing/qgsalgorithmcheckgeometryoverlap.cpp +++ b/src/analysis/processing/qgsalgorithmcheckgeometryoverlap.cpp @@ -92,7 +92,7 @@ void QgsGeometryCheckOverlapAlgorithm::initAlgorithm( const QVariantMap &configu QStringLiteral( "MIN_OVERLAP_AREA" ), QObject::tr( "Minimum overlap area" ), Qgis::ProcessingNumberParameterType::Double, 0, false, 0.0 ) ); - std::unique_ptr tolerance = std::make_unique( + auto tolerance = std::make_unique( QStringLiteral( "TOLERANCE" ), QObject::tr( "Tolerance" ), Qgis::ProcessingNumberParameterType::Integer, 8, false, 1, 13 ); tolerance->setFlags( tolerance->flags() | Qgis::ProcessingParameterFlag::Advanced ); diff --git a/src/analysis/processing/qgsalgorithmcheckgeometrypointcoveredbyline.cpp b/src/analysis/processing/qgsalgorithmcheckgeometrypointcoveredbyline.cpp index 33bbc9c147b..9effcd4951b 100644 --- a/src/analysis/processing/qgsalgorithmcheckgeometrypointcoveredbyline.cpp +++ b/src/analysis/processing/qgsalgorithmcheckgeometrypointcoveredbyline.cpp @@ -88,7 +88,7 @@ void QgsGeometryCheckPointCoveredByLineAlgorithm::initAlgorithm( const QVariantM QStringLiteral( "ERRORS" ), QObject::tr( "Points not covered by a line" ), Qgis::ProcessingSourceType::VectorPoint ) ); - std::unique_ptr tolerance = std::make_unique( + auto tolerance = std::make_unique( QStringLiteral( "TOLERANCE" ), QObject::tr( "Tolerance" ), Qgis::ProcessingNumberParameterType::Integer, 8, false, 1, 13 ); tolerance->setFlags( tolerance->flags() | Qgis::ProcessingParameterFlag::Advanced ); diff --git a/src/analysis/processing/qgsalgorithmcheckgeometrypointinpolygon.cpp b/src/analysis/processing/qgsalgorithmcheckgeometrypointinpolygon.cpp index 4a3dbf4da30..6ba2d7dc4f9 100644 --- a/src/analysis/processing/qgsalgorithmcheckgeometrypointinpolygon.cpp +++ b/src/analysis/processing/qgsalgorithmcheckgeometrypointinpolygon.cpp @@ -88,7 +88,7 @@ void QgsGeometryCheckPointInPolygonAlgorithm::initAlgorithm( const QVariantMap & QStringLiteral( "ERRORS" ), QObject::tr( "Points outside polygons errors" ), Qgis::ProcessingSourceType::VectorPoint ) ); - std::unique_ptr tolerance = std::make_unique( + auto tolerance = std::make_unique( QStringLiteral( "TOLERANCE" ), QObject::tr( "Tolerance" ), Qgis::ProcessingNumberParameterType::Integer, 8, false, 1, 13 ); tolerance->setFlags( tolerance->flags() | Qgis::ProcessingParameterFlag::Advanced ); diff --git a/src/analysis/processing/qgsalgorithmcheckgeometrysegmentlength.cpp b/src/analysis/processing/qgsalgorithmcheckgeometrysegmentlength.cpp index dde82f57d93..ef671c6a58b 100644 --- a/src/analysis/processing/qgsalgorithmcheckgeometrysegmentlength.cpp +++ b/src/analysis/processing/qgsalgorithmcheckgeometrysegmentlength.cpp @@ -93,7 +93,7 @@ void QgsGeometryCheckSegmentLengthAlgorithm::initAlgorithm( const QVariantMap &c QStringLiteral( "MIN_SEGMENT_LENGTH" ), QObject::tr( "Minimum segment length" ), Qgis::ProcessingNumberParameterType::Double, 0, false, 0.0 ) ); - std::unique_ptr tolerance = std::make_unique( + auto tolerance = std::make_unique( QStringLiteral( "TOLERANCE" ), QObject::tr( "Tolerance" ), Qgis::ProcessingNumberParameterType::Integer, 8, false, 1, 13 ); tolerance->setFlags( tolerance->flags() | Qgis::ProcessingParameterFlag::Advanced ); diff --git a/src/analysis/processing/qgsalgorithmcheckgeometryselfcontact.cpp b/src/analysis/processing/qgsalgorithmcheckgeometryselfcontact.cpp index 03078bce509..82829ea1cbd 100644 --- a/src/analysis/processing/qgsalgorithmcheckgeometryselfcontact.cpp +++ b/src/analysis/processing/qgsalgorithmcheckgeometryselfcontact.cpp @@ -89,7 +89,7 @@ void QgsGeometryCheckSelfContactAlgorithm::initAlgorithm( const QVariantMap &con QStringLiteral( "OUTPUT" ), QObject::tr( "Self contact features" ), Qgis::ProcessingSourceType::VectorAnyGeometry, QVariant(), true, false ) ); - std::unique_ptr tolerance = std::make_unique( + auto tolerance = std::make_unique( QStringLiteral( "TOLERANCE" ), QObject::tr( "Tolerance" ), Qgis::ProcessingNumberParameterType::Integer, 8, false, 1, 13 ); tolerance->setFlags( tolerance->flags() | Qgis::ProcessingParameterFlag::Advanced ); diff --git a/src/analysis/processing/qgsalgorithmcheckgeometryselfintersection.cpp b/src/analysis/processing/qgsalgorithmcheckgeometryselfintersection.cpp index 068169cecd4..40fd3bbf8a0 100644 --- a/src/analysis/processing/qgsalgorithmcheckgeometryselfintersection.cpp +++ b/src/analysis/processing/qgsalgorithmcheckgeometryselfintersection.cpp @@ -91,7 +91,7 @@ void QgsGeometryCheckSelfIntersectionAlgorithm::initAlgorithm( const QVariantMap QStringLiteral( "OUTPUT" ), QObject::tr( "Self-intersecting features" ), Qgis::ProcessingSourceType::VectorAnyGeometry, QVariant(), true, false ) ); - std::unique_ptr tolerance = std::make_unique( + auto tolerance = std::make_unique( QStringLiteral( "TOLERANCE" ), QObject::tr( "Tolerance" ), Qgis::ProcessingNumberParameterType::Integer, 8, false, 1, 13 ); tolerance->setFlags( tolerance->flags() | Qgis::ProcessingParameterFlag::Advanced ); diff --git a/src/analysis/processing/qgsalgorithmcheckgeometrysliverpolygon.cpp b/src/analysis/processing/qgsalgorithmcheckgeometrysliverpolygon.cpp index 423f21fb0bf..89c463fb7ef 100644 --- a/src/analysis/processing/qgsalgorithmcheckgeometrysliverpolygon.cpp +++ b/src/analysis/processing/qgsalgorithmcheckgeometrysliverpolygon.cpp @@ -100,7 +100,7 @@ void QgsGeometryCheckSliverPolygonAlgorithm::initAlgorithm( const QVariantMap &c QStringLiteral( "MAX_AREA" ), QObject::tr( "Maximum area (map units squared)" ), Qgis::ProcessingNumberParameterType::Double, 0, false, 0.0 ) ); - std::unique_ptr tolerance = std::make_unique( + auto tolerance = std::make_unique( QStringLiteral( "TOLERANCE" ), QObject::tr( "Tolerance" ), Qgis::ProcessingNumberParameterType::Integer, 8, false, 1, 13 ); tolerance->setFlags( tolerance->flags() | Qgis::ProcessingParameterFlag::Advanced ); diff --git a/src/analysis/processing/qgsalgorithmclimb.cpp b/src/analysis/processing/qgsalgorithmclimb.cpp index 42018012094..d2353436c57 100644 --- a/src/analysis/processing/qgsalgorithmclimb.cpp +++ b/src/analysis/processing/qgsalgorithmclimb.cpp @@ -196,11 +196,11 @@ QVariantMap QgsClimbAlgorithm::processAlgorithm( const QVariantMap ¶meters, if ( !noGeometry.empty() ) { - feedback->pushInfo( QObject::tr( "The following features do not have geometry: %1" ).arg( noGeometry.join( QStringLiteral( ", " ) ) ) ); + feedback->pushInfo( QObject::tr( "The following features do not have geometry: %1" ).arg( noGeometry.join( QLatin1String( ", " ) ) ) ); } if ( !noZValue.empty() ) { - feedback->pushInfo( QObject::tr( "The following points do not have Z value: %1" ).arg( noZValue.join( QStringLiteral( ", " ) ) ) ); + feedback->pushInfo( QObject::tr( "The following points do not have Z value: %1" ).arg( noZValue.join( QLatin1String( ", " ) ) ) ); } QVariantMap results; diff --git a/src/analysis/processing/qgsalgorithmfixgeometryangle.cpp b/src/analysis/processing/qgsalgorithmfixgeometryangle.cpp index b1b8f259fc3..9b8b4a8d3f8 100644 --- a/src/analysis/processing/qgsalgorithmfixgeometryangle.cpp +++ b/src/analysis/processing/qgsalgorithmfixgeometryangle.cpp @@ -107,7 +107,7 @@ void QgsFixGeometryAngleAlgorithm::initAlgorithm( const QVariantMap &configurati QStringLiteral( "REPORT" ), QObject::tr( "Report layer from fixing small angles" ), Qgis::ProcessingSourceType::VectorPoint ) ); - std::unique_ptr tolerance = std::make_unique( + auto tolerance = std::make_unique( QStringLiteral( "TOLERANCE" ), QObject::tr( "Tolerance" ), Qgis::ProcessingNumberParameterType::Integer, 8, false, 1, 13 ); tolerance->setFlags( tolerance->flags() | Qgis::ProcessingParameterFlag::Advanced ); diff --git a/src/analysis/processing/qgsalgorithmfixgeometryarea.cpp b/src/analysis/processing/qgsalgorithmfixgeometryarea.cpp index eb1f86b7095..72898935b92 100644 --- a/src/analysis/processing/qgsalgorithmfixgeometryarea.cpp +++ b/src/analysis/processing/qgsalgorithmfixgeometryarea.cpp @@ -120,7 +120,7 @@ void QgsFixGeometryAreaAlgorithm::initAlgorithm( const QVariantMap &configuratio QStringLiteral( "REPORT" ), QObject::tr( "Report layer from merging small polygons" ), Qgis::ProcessingSourceType::VectorPoint ) ); - std::unique_ptr tolerance = std::make_unique( + auto tolerance = std::make_unique( QStringLiteral( "TOLERANCE" ), QObject::tr( "Tolerance" ), Qgis::ProcessingNumberParameterType::Integer, 8, false, 1, 13 ); tolerance->setFlags( tolerance->flags() | Qgis::ProcessingParameterFlag::Advanced ); diff --git a/src/analysis/processing/qgsalgorithmfixgeometryduplicatenodes.cpp b/src/analysis/processing/qgsalgorithmfixgeometryduplicatenodes.cpp index 60416128b8a..e33e7554e47 100644 --- a/src/analysis/processing/qgsalgorithmfixgeometryduplicatenodes.cpp +++ b/src/analysis/processing/qgsalgorithmfixgeometryduplicatenodes.cpp @@ -104,7 +104,7 @@ void QgsFixGeometryDuplicateNodesAlgorithm::initAlgorithm( const QVariantMap &co QStringLiteral( "REPORT" ), QObject::tr( "Report layer from fixing duplicate vertices" ), Qgis::ProcessingSourceType::VectorPoint ) ); - std::unique_ptr tolerance = std::make_unique( + auto tolerance = std::make_unique( QStringLiteral( "TOLERANCE" ), QObject::tr( "Tolerance" ), Qgis::ProcessingNumberParameterType::Integer, 8, false, 1, 13 ); tolerance->setFlags( tolerance->flags() | Qgis::ProcessingParameterFlag::Advanced ); diff --git a/src/analysis/processing/qgsalgorithmfixgeometrygap.cpp b/src/analysis/processing/qgsalgorithmfixgeometrygap.cpp index fba237e1b0e..aa306d3c881 100644 --- a/src/analysis/processing/qgsalgorithmfixgeometrygap.cpp +++ b/src/analysis/processing/qgsalgorithmfixgeometrygap.cpp @@ -108,7 +108,7 @@ void QgsFixGeometryGapAlgorithm::initAlgorithm( const QVariantMap &configuration QStringLiteral( "REPORT" ), QObject::tr( "Report layer from fixing gaps" ), Qgis::ProcessingSourceType::VectorPoint ) ); - std::unique_ptr tolerance = std::make_unique( + auto tolerance = std::make_unique( QStringLiteral( "TOLERANCE" ), QObject::tr( "Tolerance" ), Qgis::ProcessingNumberParameterType::Integer, 8, false, 1, 13 ); tolerance->setFlags( tolerance->flags() | Qgis::ProcessingParameterFlag::Advanced ); diff --git a/src/analysis/processing/qgsalgorithmfixgeometryhole.cpp b/src/analysis/processing/qgsalgorithmfixgeometryhole.cpp index 2b8ce22e835..9d5c056de64 100644 --- a/src/analysis/processing/qgsalgorithmfixgeometryhole.cpp +++ b/src/analysis/processing/qgsalgorithmfixgeometryhole.cpp @@ -104,7 +104,7 @@ void QgsFixGeometryHoleAlgorithm::initAlgorithm( const QVariantMap &configuratio QStringLiteral( "REPORT" ), QObject::tr( "Report layer from fixing holes" ), Qgis::ProcessingSourceType::VectorPoint ) ); - std::unique_ptr tolerance = std::make_unique( + auto tolerance = std::make_unique( QStringLiteral( "TOLERANCE" ), QObject::tr( "Tolerance" ), Qgis::ProcessingNumberParameterType::Integer, 8, false, 1, 13 ); tolerance->setFlags( tolerance->flags() | Qgis::ProcessingParameterFlag::Advanced ); diff --git a/src/analysis/processing/qgsalgorithmfixgeometrymissingvertex.cpp b/src/analysis/processing/qgsalgorithmfixgeometrymissingvertex.cpp index d3c9f8f9c17..93e49af1e0c 100644 --- a/src/analysis/processing/qgsalgorithmfixgeometrymissingvertex.cpp +++ b/src/analysis/processing/qgsalgorithmfixgeometrymissingvertex.cpp @@ -105,7 +105,7 @@ void QgsFixGeometryMissingVertexAlgorithm::initAlgorithm( const QVariantMap &con QStringLiteral( "REPORT" ), QObject::tr( "Report layer from fixing border vertices" ), Qgis::ProcessingSourceType::VectorPoint ) ); - std::unique_ptr tolerance = std::make_unique( + auto tolerance = std::make_unique( QStringLiteral( "TOLERANCE" ), QObject::tr( "Tolerance" ), Qgis::ProcessingNumberParameterType::Integer, 8, false, 1, 13 ); tolerance->setFlags( tolerance->flags() | Qgis::ProcessingParameterFlag::Advanced ); diff --git a/src/analysis/processing/qgsalgorithmfixgeometrymultipart.cpp b/src/analysis/processing/qgsalgorithmfixgeometrymultipart.cpp index e14a759602b..9907b70857f 100644 --- a/src/analysis/processing/qgsalgorithmfixgeometrymultipart.cpp +++ b/src/analysis/processing/qgsalgorithmfixgeometrymultipart.cpp @@ -91,7 +91,7 @@ void QgsFixGeometryMultipartAlgorithm::initAlgorithm( const QVariantMap &configu QStringLiteral( "REPORT" ), QObject::tr( "Report layer from fixing multiparts" ), Qgis::ProcessingSourceType::VectorPoint ) ); - std::unique_ptr tolerance = std::make_unique( + auto tolerance = std::make_unique( QStringLiteral( "TOLERANCE" ), QObject::tr( "Tolerance" ), Qgis::ProcessingNumberParameterType::Integer, 8, false, 1, 13 ); tolerance->setFlags( tolerance->flags() | Qgis::ProcessingParameterFlag::Advanced ); diff --git a/src/analysis/processing/qgsalgorithmfixgeometryoverlap.cpp b/src/analysis/processing/qgsalgorithmfixgeometryoverlap.cpp index 3ca4a9ee419..eed1af511df 100644 --- a/src/analysis/processing/qgsalgorithmfixgeometryoverlap.cpp +++ b/src/analysis/processing/qgsalgorithmfixgeometryoverlap.cpp @@ -99,7 +99,7 @@ void QgsFixGeometryOverlapAlgorithm::initAlgorithm( const QVariantMap &configura QStringLiteral( "REPORT" ), QObject::tr( "Report layer from fixing overlaps" ), Qgis::ProcessingSourceType::VectorPoint ) ); - std::unique_ptr tolerance = std::make_unique( + auto tolerance = std::make_unique( QStringLiteral( "TOLERANCE" ), QObject::tr( "Tolerance" ), Qgis::ProcessingNumberParameterType::Integer, 8, false, 1, 13 ); tolerance->setFlags( tolerance->flags() | Qgis::ProcessingParameterFlag::Advanced ); diff --git a/src/analysis/processing/qgsalgorithmfixgeometryselfintersection.cpp b/src/analysis/processing/qgsalgorithmfixgeometryselfintersection.cpp index 47bcd5579e2..ac0907be4df 100644 --- a/src/analysis/processing/qgsalgorithmfixgeometryselfintersection.cpp +++ b/src/analysis/processing/qgsalgorithmfixgeometryselfintersection.cpp @@ -129,7 +129,7 @@ void QgsFixGeometrySelfIntersectionAlgorithm::initAlgorithm( const QVariantMap & QStringLiteral( "REPORT" ), QObject::tr( "Report layer from fixing self-intersections" ), Qgis::ProcessingSourceType::VectorPoint ) ); - std::unique_ptr tolerance = std::make_unique( + auto tolerance = std::make_unique( QStringLiteral( "TOLERANCE" ), QObject::tr( "Tolerance" ), Qgis::ProcessingNumberParameterType::Integer, 8, false, 1, 13 ); tolerance->setFlags( tolerance->flags() | Qgis::ProcessingParameterFlag::Advanced ); diff --git a/src/analysis/processing/qgsalgorithmremovepartsbyarea.cpp b/src/analysis/processing/qgsalgorithmremovepartsbyarea.cpp index 2c5e88c8a9c..260bcac2217 100644 --- a/src/analysis/processing/qgsalgorithmremovepartsbyarea.cpp +++ b/src/analysis/processing/qgsalgorithmremovepartsbyarea.cpp @@ -90,7 +90,7 @@ Qgis::ProcessingFeatureSourceFlags QgsRemovePartsByAreaAlgorithm::sourceFlags() void QgsRemovePartsByAreaAlgorithm::initParameters( const QVariantMap & ) { - std::unique_ptr< QgsProcessingParameterArea > minArea = std::make_unique< QgsProcessingParameterArea >( QStringLiteral( "MIN_AREA" ), QObject::tr( "Remove parts with area less than" ), 0.0, QStringLiteral( "INPUT" ), false, 0 ); + auto minArea = std::make_unique< QgsProcessingParameterArea >( QStringLiteral( "MIN_AREA" ), QObject::tr( "Remove parts with area less than" ), 0.0, QStringLiteral( "INPUT" ), false, 0 ); minArea->setIsDynamic( true ); minArea->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "MIN_AREA" ), QObject::tr( "Remove parts with area less than" ), QgsPropertyDefinition::DoublePositive ) ); minArea->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); diff --git a/src/analysis/processing/qgsalgorithmremovepartsbylength.cpp b/src/analysis/processing/qgsalgorithmremovepartsbylength.cpp index 2c1fdb9e47b..908f6ba397b 100644 --- a/src/analysis/processing/qgsalgorithmremovepartsbylength.cpp +++ b/src/analysis/processing/qgsalgorithmremovepartsbylength.cpp @@ -90,7 +90,7 @@ Qgis::ProcessingFeatureSourceFlags QgsRemovePartsByLengthAlgorithm::sourceFlags( void QgsRemovePartsByLengthAlgorithm::initParameters( const QVariantMap & ) { - std::unique_ptr< QgsProcessingParameterDistance > minLength = std::make_unique< QgsProcessingParameterDistance >( QStringLiteral( "MIN_LENGTH" ), QObject::tr( "Remove parts with lengths less than" ), 0.0, QStringLiteral( "INPUT" ), false, 0 ); + auto minLength = std::make_unique< QgsProcessingParameterDistance >( QStringLiteral( "MIN_LENGTH" ), QObject::tr( "Remove parts with lengths less than" ), 0.0, QStringLiteral( "INPUT" ), false, 0 ); minLength->setIsDynamic( true ); minLength->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "MIN_LENGTH" ), QObject::tr( "Remove parts with length less than" ), QgsPropertyDefinition::DoublePositive ) ); minLength->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); diff --git a/src/auth/planetary_computer/gui/qgsauthplanetarycomputeredit.cpp b/src/auth/planetary_computer/gui/qgsauthplanetarycomputeredit.cpp index d6688428dac..ca16c7daa6b 100644 --- a/src/auth/planetary_computer/gui/qgsauthplanetarycomputeredit.cpp +++ b/src/auth/planetary_computer/gui/qgsauthplanetarycomputeredit.cpp @@ -157,7 +157,7 @@ void QgsAuthPlanetaryComputerEdit::updateServerType( int indx ) lblTenantId->setVisible( isPro ); leTenantId->setVisible( isPro ); - const QString openHelp = tr( "Use this server type for %1 - the data are publicly accessible and do not require an account." ).arg( QStringLiteral( "https://planetarycomputer.microsoft.com/" ) ); + const QString openHelp = tr( "Use this server type for %1 - the data are publicly accessible and do not require an account." ).arg( QLatin1String( "https://planetarycomputer.microsoft.com/" ) ); const QString proHelp = tr( "Use this server type for Planetary Computer Pro instances.
" "The Directory (tenant) and Application (client) IDs can be found in your organization's Microsoft Entra ID main and application page respectively.
" diff --git a/src/core/geometry/qgsgeometry.cpp b/src/core/geometry/qgsgeometry.cpp index f9f4cf37144..89c34a2d949 100644 --- a/src/core/geometry/qgsgeometry.cpp +++ b/src/core/geometry/qgsgeometry.cpp @@ -4627,7 +4627,7 @@ QgsGeometry QgsGeometry::doChamferFillet( ChamferFilletOperationType op, int ver // insert \a result geometry (obtain by the chamfer/fillet operation) back into original \a inputPoly polygon auto updatePolygon = []( const QgsPolygon * inputPoly, QgsAbstractGeometry * result, int modifiedRing ) -> std::unique_ptr { - std::unique_ptr newPoly = std::make_unique(); + auto newPoly = std::make_unique(); for ( int ringIndex = 0; ringIndex < inputPoly->numInteriorRings() + 1; ++ringIndex ) { if ( ringIndex == modifiedRing ) @@ -4656,7 +4656,7 @@ QgsGeometry QgsGeometry::doChamferFillet( ChamferFilletOperationType op, int ver { if ( modifiedPart >= 0 ) { - std::unique_ptr newMultiLine = std::make_unique(); + auto newMultiLine = std::make_unique(); int partIndex = 0; for ( QgsMultiLineString::part_iterator partIte = inputMultiLine->parts_begin(); partIte != inputMultiLine->parts_end(); ++partIte ) { @@ -4686,7 +4686,7 @@ QgsGeometry QgsGeometry::doChamferFillet( ChamferFilletOperationType op, int ver // geomType == Qgis::GeometryType::Polygon if ( modifiedPart >= 0 ) { - std::unique_ptr newMultiPoly = std::make_unique(); + auto newMultiPoly = std::make_unique(); int partIndex = 0; for ( QgsAbstractGeometry::part_iterator partIte = inputMultiPoly->parts_begin(); partIte != inputMultiPoly->parts_end(); ++partIte ) { diff --git a/src/core/layout/qgslayoutitemelevationprofile.cpp b/src/core/layout/qgslayoutitemelevationprofile.cpp index 56cc485671f..2fb9bff57c4 100644 --- a/src/core/layout/qgslayoutitemelevationprofile.cpp +++ b/src/core/layout/qgslayoutitemelevationprofile.cpp @@ -972,7 +972,7 @@ bool QgsLayoutItemElevationProfile::readPropertiesFromElement( const QDomElement QDomElement sourceElement = sourcesElement.firstChildElement(); while ( !sourceElement.isNull() ) { - if ( sourceElement.tagName() == QStringLiteral( "profileCustomSource" ) ) + if ( sourceElement.tagName() == QLatin1String( "profileCustomSource" ) ) { const QString sourceId = sourceElement.attribute( QStringLiteral( "id" ) ); if ( QgsAbstractProfileSource *profileSource = QgsApplication::profileSourceRegistry()->findSourceById( sourceId ) ) @@ -980,7 +980,7 @@ bool QgsLayoutItemElevationProfile::readPropertiesFromElement( const QDomElement mSources.append( profileSource ); } } - else if ( sourceElement.tagName() == QStringLiteral( "profileLayerSource" ) ) + else if ( sourceElement.tagName() == QLatin1String( "profileLayerSource" ) ) { QgsMapLayerRef ref; ref.readXml( sourceElement, context ); diff --git a/src/core/pal/problem.cpp b/src/core/pal/problem.cpp index 6a02b42eff3..cb076349969 100644 --- a/src/core/pal/problem.cpp +++ b/src/core/pal/problem.cpp @@ -403,7 +403,7 @@ inline std::unique_ptr Problem::chain( int seed ) { // A lot of conflict : make them inactive and store chain - std::unique_ptr< Chain > newChain = std::make_unique< Chain >(); + auto newChain = std::make_unique< Chain >(); newChain->degree = currentChain.size() + 1 + conflicts.size(); newChain->feat.resize( newChain->degree ); newChain->label.resize( newChain->degree ); diff --git a/src/core/plot/qgsvectorlayerplotdatagatherer.cpp b/src/core/plot/qgsvectorlayerplotdatagatherer.cpp index 6ecf647c7b3..579f4f1416e 100644 --- a/src/core/plot/qgsvectorlayerplotdatagatherer.cpp +++ b/src/core/plot/qgsvectorlayerplotdatagatherer.cpp @@ -44,7 +44,7 @@ bool QgsVectorLayerXyPlotDataGatherer::run() gatheredSeries.reserve( mSeriesDetails.size() ); for ( int i = 0; i < mSeriesDetails.size(); i++ ) { - std::unique_ptr series = std::make_unique(); + auto series = std::make_unique(); gatheredSeries.emplace_back( std::move( series ) ); gatheredSeriesCategoriesSum << QMap(); } diff --git a/src/core/project/qgsproject.cpp b/src/core/project/qgsproject.cpp index a58b80debf2..158ab3b956f 100644 --- a/src/core/project/qgsproject.cpp +++ b/src/core/project/qgsproject.cpp @@ -663,11 +663,11 @@ void QgsProject::registerTranslatableObjects( QgsTranslationContext *translation translationContext->registerTranslation( QStringLiteral( "project:layers:%1:fieldaliases" ).arg( vlayer->id() ), fieldName ); - if ( field.editorWidgetSetup().type() == QStringLiteral( "ValueRelation" ) ) + if ( field.editorWidgetSetup().type() == QLatin1String( "ValueRelation" ) ) { translationContext->registerTranslation( QStringLiteral( "project:layers:%1:fields:%2:valuerelationvalue" ).arg( vlayer->id(), field.name() ), field.editorWidgetSetup().config().value( QStringLiteral( "Value" ) ).toString() ); } - if ( field.editorWidgetSetup().type() == QStringLiteral( "ValueMap" ) ) + if ( field.editorWidgetSetup().type() == QLatin1String( "ValueMap" ) ) { if ( field.editorWidgetSetup().config().value( QStringLiteral( "map" ) ).canConvert>() ) { @@ -4003,11 +4003,11 @@ bool QgsProject::createEmbeddedLayer( const QString &layerId, const QString &pro if ( e.isNull() ) { e = propertiesElem.firstChildElement( QStringLiteral( "properties" ) ); - while ( !e.isNull() && e.attribute( QStringLiteral( "name" ) ) != QStringLiteral( "Paths" ) ) + while ( !e.isNull() && e.attribute( QStringLiteral( "name" ) ) != QLatin1String( "Paths" ) ) e = e.nextSiblingElement( QStringLiteral( "properties" ) ); e = e.firstChildElement( QStringLiteral( "properties" ) ); - while ( !e.isNull() && e.attribute( QStringLiteral( "name" ) ) != QStringLiteral( "Absolute" ) ) + while ( !e.isNull() && e.attribute( QStringLiteral( "name" ) ) != QLatin1String( "Absolute" ) ) e = e.nextSiblingElement( QStringLiteral( "properties" ) ); } else diff --git a/src/core/project/qgsprojectproperty.cpp b/src/core/project/qgsprojectproperty.cpp index 1af598012b4..0e1cdbfa276 100644 --- a/src/core/project/qgsprojectproperty.cpp +++ b/src/core/project/qgsprojectproperty.cpp @@ -365,7 +365,7 @@ bool QgsProjectPropertyKey::readXml( const QDomNode &keyNode ) const QDomNode subkey = subkeys.item( i ); QString name; - if ( subkey.nodeName() == QStringLiteral( "properties" ) && + if ( subkey.nodeName() == QLatin1String( "properties" ) && subkey.hasAttributes() && // if we have attributes subkey.isElement() && // and we're an element subkey.toElement().hasAttribute( QStringLiteral( "name" ) ) ) // and we have a "name" attribute diff --git a/src/core/qgscommandlineutils.cpp b/src/core/qgscommandlineutils.cpp index 439fe44575c..27a3c3f7440 100644 --- a/src/core/qgscommandlineutils.cpp +++ b/src/core/qgscommandlineutils.cpp @@ -129,7 +129,7 @@ QString QgsCommandLineUtils::allVersions( ) versionString += QStringLiteral( "SFCGAL version %1\n" ).arg( sfcgalVersionCompiled ); } #else - versionString += QStringLiteral( "No support for SFCGAL\n" ); + versionString += QLatin1String( "No support for SFCGAL\n" ); #endif // SQLite version diff --git a/src/core/qgsogrutils.cpp b/src/core/qgsogrutils.cpp index d3ddffbd620..b27d90bde72 100644 --- a/src/core/qgsogrutils.cpp +++ b/src/core/qgsogrutils.cpp @@ -572,7 +572,7 @@ QVariant QgsOgrUtils::getOgrFeatureAttribute( OGRFeatureH ogrFet, const QgsField { case QMetaType::Type::QString: { - if ( field.typeName() != QStringLiteral( "JSON" ) || ! getJsonValue() ) + if ( field.typeName() != QLatin1String( "JSON" ) || ! getJsonValue() ) { if ( encoding ) value = QVariant( encoding->toUnicode( OGR_F_GetFieldAsString( ogrFet, attIndex ) ) ); @@ -641,7 +641,7 @@ QVariant QgsOgrUtils::getOgrFeatureAttribute( OGRFeatureH ogrFet, const QgsField case QMetaType::Type::QStringList: { - if ( field.typeName() != QStringLiteral( "JSON" ) || ! getJsonValue() ) + if ( field.typeName() != QLatin1String( "JSON" ) || ! getJsonValue() ) { QStringList list; char **lst = OGR_F_GetFieldAsStringList( ogrFet, attIndex ); @@ -668,7 +668,7 @@ QVariant QgsOgrUtils::getOgrFeatureAttribute( OGRFeatureH ogrFet, const QgsField { case QMetaType::Type::QString: { - if ( field.typeName() != QStringLiteral( "JSON" ) || ! getJsonValue() ) + if ( field.typeName() != QLatin1String( "JSON" ) || ! getJsonValue() ) { QStringList list; char **lst = OGR_F_GetFieldAsStringList( ogrFet, attIndex ); @@ -691,7 +691,7 @@ QVariant QgsOgrUtils::getOgrFeatureAttribute( OGRFeatureH ogrFet, const QgsField case QMetaType::Type::Int: { - if ( field.typeName() != QStringLiteral( "JSON" ) || ! getJsonValue() ) + if ( field.typeName() != QLatin1String( "JSON" ) || ! getJsonValue() ) { QVariantList list; int count = 0; @@ -711,7 +711,7 @@ QVariant QgsOgrUtils::getOgrFeatureAttribute( OGRFeatureH ogrFet, const QgsField case QMetaType::Type::Double: { - if ( field.typeName() != QStringLiteral( "JSON" ) || ! getJsonValue() ) + if ( field.typeName() != QLatin1String( "JSON" ) || ! getJsonValue() ) { QVariantList list; int count = 0; @@ -731,7 +731,7 @@ QVariant QgsOgrUtils::getOgrFeatureAttribute( OGRFeatureH ogrFet, const QgsField case QMetaType::Type::LongLong: { - if ( field.typeName() != QStringLiteral( "JSON" ) || ! getJsonValue() ) + if ( field.typeName() != QLatin1String( "JSON" ) || ! getJsonValue() ) { QVariantList list; int count = 0; diff --git a/src/core/symbology/qgsmarkersymbollayer.cpp b/src/core/symbology/qgsmarkersymbollayer.cpp index 9d181230ee7..72383478350 100644 --- a/src/core/symbology/qgsmarkersymbollayer.cpp +++ b/src/core/symbology/qgsmarkersymbollayer.cpp @@ -3563,7 +3563,7 @@ bool QgsRasterMarkerSymbolLayer::writeSldMarker( QDomDocument &doc, QDomElement QMimeType mimeType; QString base64data; - if ( mPath.startsWith( QStringLiteral( "base64:" ) ) ) + if ( mPath.startsWith( QLatin1String( "base64:" ) ) ) { base64data = mPath.mid( 7 ); } @@ -3601,7 +3601,7 @@ bool QgsRasterMarkerSymbolLayer::writeSldMarker( QDomDocument &doc, QDomElement extGraphElem.appendChild( onlineResElem ); // determine mime type - if ( mPath.startsWith( QStringLiteral( "http://" ) ) || mPath.startsWith( QStringLiteral( "https://" ) ) ) + if ( mPath.startsWith( QLatin1String( "http://" ) ) || mPath.startsWith( QLatin1String( "https://" ) ) ) { // Qt can't guess mime type for remote URLs, and it seems geoserver can handle wrong image mime types // but not generic ones, so let's hardcode to png. diff --git a/src/core/vector/qgsvectorlayer.cpp b/src/core/vector/qgsvectorlayer.cpp index 8fa57b7d0c2..00094a87ad2 100644 --- a/src/core/vector/qgsvectorlayer.cpp +++ b/src/core/vector/qgsvectorlayer.cpp @@ -2708,11 +2708,11 @@ bool QgsVectorLayer::readSymbology( const QDomNode &layerNode, QString &errorMes const QDomElement optionsElem = cfgElem.childNodes().at( 0 ).toElement(); QVariantMap optionsMap = QgsXmlUtils::readVariant( optionsElem ).toMap(); // translate widget configuration strings - if ( widgetType == QStringLiteral( "ValueRelation" ) ) + if ( widgetType == QLatin1String( "ValueRelation" ) ) { optionsMap[ QStringLiteral( "Value" ) ] = context.projectTranslator()->translate( QStringLiteral( "project:layers:%1:fields:%2:valuerelationvalue" ).arg( layerNode.namedItem( QStringLiteral( "id" ) ).toElement().text(), fieldName ), optionsMap[ QStringLiteral( "Value" ) ].toString() ); } - if ( widgetType == QStringLiteral( "ValueMap" ) ) + if ( widgetType == QLatin1String( "ValueMap" ) ) { if ( optionsMap[ QStringLiteral( "map" ) ].canConvert>() ) { diff --git a/src/core/vectortile/qgsvectortileutils.cpp b/src/core/vectortile/qgsvectortileutils.cpp index b00acf21f21..d63b5d7b733 100644 --- a/src/core/vectortile/qgsvectortileutils.cpp +++ b/src/core/vectortile/qgsvectortileutils.cpp @@ -344,7 +344,7 @@ void QgsVectorTileUtils::loadSprites( const QVariantMap &styleDefinition, QgsMap { return sprite; } - else if ( sprite.startsWith( QLatin1String( "/" ) ) ) + else if ( sprite.startsWith( QLatin1Char( '/' ) ) ) { const QUrl url( styleUrl ); return QStringLiteral( "%1://%2%3" ).arg( url.scheme(), url.host(), sprite ); diff --git a/src/gui/elevation/qgselevationprofilelayertreeview.cpp b/src/gui/elevation/qgselevationprofilelayertreeview.cpp index ba3ab5ffeee..1d6b15e13ac 100644 --- a/src/gui/elevation/qgselevationprofilelayertreeview.cpp +++ b/src/gui/elevation/qgselevationprofilelayertreeview.cpp @@ -491,7 +491,7 @@ void QgsElevationProfileLayerTreeView::populateInitialSources( QgsProject *proje void QgsElevationProfileLayerTreeView::addNodeForRegisteredSource( const QString &sourceId, const QString &sourceName ) { - std::unique_ptr< QgsLayerTreeCustomNode > customNode = std::make_unique< QgsLayerTreeCustomNode >( sourceId, sourceName.isEmpty() ? sourceId : sourceName ); + auto customNode = std::make_unique< QgsLayerTreeCustomNode >( sourceId, sourceName.isEmpty() ? sourceId : sourceName ); customNode->setItemVisibilityChecked( true ); // Mark the node so that we know which custom nodes correspond to elevation profile sources customNode->setCustomProperty( QStringLiteral( "source" ), QgsElevationProfileLayerTreeView::CUSTOM_NODE_ELEVATION_PROFILE_SOURCE ); diff --git a/src/gui/layout/qgslayoutelevationprofilewidget.cpp b/src/gui/layout/qgslayoutelevationprofilewidget.cpp index 5d35ea4a391..dfed485bda3 100644 --- a/src/gui/layout/qgslayoutelevationprofilewidget.cpp +++ b/src/gui/layout/qgslayoutelevationprofilewidget.cpp @@ -578,7 +578,7 @@ QgsExpressionContext QgsLayoutElevationProfileWidget::createExpressionContext() { QgsExpressionContext context = mProfile->createExpressionContext(); - std::unique_ptr plotScope = std::make_unique( QStringLiteral( "plot" ) ); + auto plotScope = std::make_unique( QStringLiteral( "plot" ) ); plotScope->addVariable( QgsExpressionContextScope::StaticVariable( QStringLiteral( "plot_axis" ), QString(), true ) ); plotScope->addVariable( QgsExpressionContextScope::StaticVariable( QStringLiteral( "plot_axis_value" ), 0.0, true ) ); context.appendScope( plotScope.release() ); diff --git a/src/gui/plot/qgsplotwidget.cpp b/src/gui/plot/qgsplotwidget.cpp index cb73b9ef408..9ba7c317fb8 100644 --- a/src/gui/plot/qgsplotwidget.cpp +++ b/src/gui/plot/qgsplotwidget.cpp @@ -44,12 +44,12 @@ QgsExpressionContext QgsPlotWidget::createExpressionContext() const context.appendScope( QgsExpressionContextUtils::globalScope() ); } - std::unique_ptr plotScope = std::make_unique( QStringLiteral( "plot" ) ); + auto plotScope = std::make_unique( QStringLiteral( "plot" ) ); plotScope->addVariable( QgsExpressionContextScope::StaticVariable( QStringLiteral( "plot_axis" ), QString(), true ) ); plotScope->addVariable( QgsExpressionContextScope::StaticVariable( QStringLiteral( "plot_axis_value" ), 0.0, true ) ); context.appendScope( plotScope.release() ); - std::unique_ptr chartScope = std::make_unique( QStringLiteral( "chart" ) ); + auto chartScope = std::make_unique( QStringLiteral( "chart" ) ); chartScope->addVariable( QgsExpressionContextScope::StaticVariable( QStringLiteral( "chart_category" ), QString(), true ) ); chartScope->addVariable( QgsExpressionContextScope::StaticVariable( QStringLiteral( "chart_value" ), 0.0, true ) ); context.appendScope( chartScope.release() ); diff --git a/src/gui/qgsshortcutsmanager.cpp b/src/gui/qgsshortcutsmanager.cpp index fe95844ac80..811c5871b5a 100644 --- a/src/gui/qgsshortcutsmanager.cpp +++ b/src/gui/qgsshortcutsmanager.cpp @@ -121,7 +121,7 @@ bool QgsShortcutsManager::registerAction( QAction *action, const QString &defaul QgsLogger::warning( QStringLiteral( "Duplicate shortcut registered: %1" ).arg( key ) ); #endif - const QString settingKey = mSettingsPath + ( section.isEmpty() || section.endsWith( QStringLiteral( "/" ) ) ? section : section + QStringLiteral( "/" ) ) + key; + const QString settingKey = mSettingsPath + ( section.isEmpty() || section.endsWith( QLatin1Char( '/' ) ) ? section : section + QStringLiteral( "/" ) ) + key; mActions.insert( action, { defaultSequence, settingKey } ); connect( action, &QObject::destroyed, this, [action, this]() { actionDestroyed( action ); } ); @@ -165,7 +165,7 @@ bool QgsShortcutsManager::registerShortcut( QShortcut *shortcut, const QString & QgsLogger::warning( QStringLiteral( "Duplicate shortcut registered: %1" ).arg( shortcut->objectName() ) ); #endif - const QString settingKey = mSettingsPath + ( section.isEmpty() || section.endsWith( QStringLiteral( "/" ) ) ? section : section + QStringLiteral( "/" ) ) + shortcut->objectName(); + const QString settingKey = mSettingsPath + ( section.isEmpty() || section.endsWith( QLatin1Char( '/' ) ) ? section : section + QStringLiteral( "/" ) ) + shortcut->objectName(); mShortcuts.insert( shortcut, { defaultSequence, settingKey } ); connect( shortcut, &QObject::destroyed, this, [shortcut, this]() { shortcutDestroyed( shortcut ); } ); diff --git a/src/gui/vector/qgsattributesformmodel.cpp b/src/gui/vector/qgsattributesformmodel.cpp index 1a301f6c2bd..267f2972c9a 100644 --- a/src/gui/vector/qgsattributesformmodel.cpp +++ b/src/gui/vector/qgsattributesformmodel.cpp @@ -1694,7 +1694,7 @@ void QgsAttributesFormLayoutModel::addContainer( QModelIndex &parent, const QStr QgsAttributesFormItem *parentItem = itemForIndex( parent ); - std::unique_ptr< QgsAttributesFormItem > containerItem = std::make_unique< QgsAttributesFormItem >( QgsAttributesFormData::Container, name, QString(), parentItem ); + auto containerItem = std::make_unique< QgsAttributesFormItem >( QgsAttributesFormData::Container, name, QString(), parentItem ); QgsAttributesFormData::AttributeFormItemData itemData; itemData.setColumnCount( columnCount ); @@ -1713,7 +1713,7 @@ void QgsAttributesFormLayoutModel::insertChild( const QModelIndex &parent, int r return; beginInsertRows( parent, row, row ); - std::unique_ptr< QgsAttributesFormItem > item = std::make_unique< QgsAttributesFormItem >(); + auto item = std::make_unique< QgsAttributesFormItem >(); item->setData( QgsAttributesFormModel::ItemIdRole, itemId ); item->setData( QgsAttributesFormModel::ItemTypeRole, itemType ); diff --git a/src/gui/vector/qgsattributesformproperties.cpp b/src/gui/vector/qgsattributesformproperties.cpp index 98fd23a26ac..81d557cfff2 100644 --- a/src/gui/vector/qgsattributesformproperties.cpp +++ b/src/gui/vector/qgsattributesformproperties.cpp @@ -1147,11 +1147,11 @@ void QgsAttributesFormProperties::pasteWidgetConfiguration() QVariantMap optionsMap = QgsXmlUtils::readVariant( optionsElem ).toMap(); QgsReadWriteContext context; // translate widget configuration strings - if ( widgetType == QStringLiteral( "ValueRelation" ) ) + if ( widgetType == QLatin1String( "ValueRelation" ) ) { optionsMap[QStringLiteral( "Value" )] = context.projectTranslator()->translate( QStringLiteral( "project:layers:%1:fields:%2:valuerelationvalue" ).arg( mLayer->id(), fieldName ), optionsMap[QStringLiteral( "Value" )].toString() ); } - if ( widgetType == QStringLiteral( "ValueMap" ) ) + if ( widgetType == QLatin1String( "ValueMap" ) ) { if ( optionsMap[QStringLiteral( "map" )].canConvert>() ) { diff --git a/src/providers/mssql/qgsmssqlprovider.cpp b/src/providers/mssql/qgsmssqlprovider.cpp index 925d76bcef0..a24db5b4715 100644 --- a/src/providers/mssql/qgsmssqlprovider.cpp +++ b/src/providers/mssql/qgsmssqlprovider.cpp @@ -1284,7 +1284,7 @@ bool QgsMssqlProvider::addAttributes( const QList &attributes ) attributeClauses.append( QStringLiteral( "[%1] %2" ).arg( it->name(), type ) ); } - statement += attributeClauses.join( QStringLiteral( ", " ) ); + statement += attributeClauses.join( QLatin1String( ", " ) ); QSqlQuery query = createQuery(); query.setForwardOnly( true ); diff --git a/src/providers/postgres/qgspostgresprovider.cpp b/src/providers/postgres/qgspostgresprovider.cpp index ba525def87c..d6f797ca6c5 100644 --- a/src/providers/postgres/qgspostgresprovider.cpp +++ b/src/providers/postgres/qgspostgresprovider.cpp @@ -5191,7 +5191,7 @@ QString QgsPostgresProvider::htmlMetadata() const ")" ) .arg( QgsPostgresConn::quotedValue( mTableName ), QgsPostgresConn::quotedValue( mSchemaName ) ); - const QString sqlWithPrivilages = QStringLiteral( "privileges AS (" + const QString sqlWithPrivileges = QStringLiteral( "privileges AS (" "SELECT table_info.oid as oid, " "COALESCE(NULLIF(CONCAT_WS(', '," "CASE WHEN has_table_privilege(table_info.oid, 'SELECT') THEN 'SELECT' END," @@ -5221,7 +5221,7 @@ QString QgsPostgresProvider::htmlMetadata() const "LEFT JOIN privileges ON table_info.oid = privileges.oid " "LEFT JOIN table_indexes_info ON table_indexes_info.table_name = table_info.table_name AND table_indexes_info.schema_name = table_info.schema_name " "LEFT JOIN pg_description ON pg_description.objoid = table_info.oid" ) - .arg( sqlWithTableInfo, sqlWithPrivilages, sqlWithIndexes ); + .arg( sqlWithTableInfo, sqlWithPrivileges, sqlWithIndexes ); QgsPostgresResult resTable( connectionRO()->LoggedPQexec( "QgsPostgresProvider", sqlMainQuery ) ); @@ -5233,7 +5233,7 @@ QString QgsPostgresProvider::htmlMetadata() const if ( resTable.PQntuples() > 0 ) { tableComment = resTable.PQgetvalue( 0, 6 ); - tableComment = tableComment.replace( QStringLiteral( "\n" ), QStringLiteral( "
" ) ); + tableComment = tableComment.replace( QLatin1String( "\n" ), QLatin1String( "
" ) ); estimateRowCount = resTable.PQgetvalue( 0, 4 ).toLongLong(); diff --git a/src/providers/postgres/qgspostgresproviderconnection.cpp b/src/providers/postgres/qgspostgresproviderconnection.cpp index 70f5ca5ae80..8989ebfea50 100644 --- a/src/providers/postgres/qgspostgresproviderconnection.cpp +++ b/src/providers/postgres/qgspostgresproviderconnection.cpp @@ -1950,7 +1950,7 @@ void QgsPostgresProviderConnection::moveTableToSchema( const QString &sourceSche const QString sqlMoveTable = sqlMoveToSchema.arg( QgsPostgresConn::quotedIdentifier( sourceSchema ), QgsPostgresConn::quotedIdentifier( tableName ), QgsPostgresConn::quotedIdentifier( targetSchema ) ); - std::shared_ptr conn = std::make_shared( QgsPostgresConn::connectionInfo( QgsDataSourceUri( uri() ), false ) ); + auto conn = std::make_shared( QgsPostgresConn::connectionInfo( QgsDataSourceUri( uri() ), false ) ); QgsPostgresLayerProperty property; // need property from target schema, it is already moved bool ok = conn->get()->supportedLayer( property, sourceSchema, tableName ); diff --git a/src/providers/wfs/qgswfsprovider.cpp b/src/providers/wfs/qgswfsprovider.cpp index c8159399d96..bda708dfcd1 100644 --- a/src/providers/wfs/qgswfsprovider.cpp +++ b/src/providers/wfs/qgswfsprovider.cpp @@ -1003,7 +1003,7 @@ QDomElement QgsWFSProvider::geometryElement( const QgsGeometry &geometry, QDomDo bool applyAxisInversion; QgsOgcUtils::GMLVersion gmlVersion; - if ( mShared->mWFSVersion.startsWith( QLatin1String( "1.1" ) ) || mShared->mWFSVersion.startsWith( QLatin1String( "2" ) ) ) + if ( mShared->mWFSVersion.startsWith( QLatin1String( "1.1" ) ) || mShared->mWFSVersion.startsWith( QLatin1Char( '2' ) ) ) { // WFS 1.1.0 uses preferably GML 3, but ESRI mapserver in 2020 doesn't like it so we stick to GML2 if ( !mShared->mServerPrefersCoordinatesForTransactions_1_1 ) diff --git a/src/providers/wfs/qgswfsprovidermetadata.cpp b/src/providers/wfs/qgswfsprovidermetadata.cpp index 15bdfd0cda1..47be83ab2ce 100644 --- a/src/providers/wfs/qgswfsprovidermetadata.cpp +++ b/src/providers/wfs/qgswfsprovidermetadata.cpp @@ -248,7 +248,7 @@ QList QgsWfsProviderMetadata::querySublayers( const // If set: always issue a GetFeature because the guessed type can't be trusted, // for example when dealing with Z geometries identified as 2D. const bool forceInitialGetFeature = dsUri.hasParam( QgsWFSConstants::URI_PARAM_FORCE_INITIAL_GET_FEATURE ) - && dsUri.param( QgsWFSConstants::URI_PARAM_FORCE_INITIAL_GET_FEATURE ).toUpper() == QStringLiteral( "TRUE" ); + && dsUri.param( QgsWFSConstants::URI_PARAM_FORCE_INITIAL_GET_FEATURE ).toUpper() == QLatin1String( "TRUE" ); if ( wfsUri.hasGeometryTypeFilter() || !caps.supportsGeometryTypeFilters() ) { diff --git a/src/server/services/wfs3/qgswfs3.cpp b/src/server/services/wfs3/qgswfs3.cpp index cf3ec78573c..65b19d50b4d 100644 --- a/src/server/services/wfs3/qgswfs3.cpp +++ b/src/server/services/wfs3/qgswfs3.cpp @@ -41,7 +41,7 @@ class QgsWfs3Module : public QgsServiceModule { rootPath = serverIface->serverSettings()->apiWfs3RootPath(); } - std::unique_ptr wfs3Api = std::make_unique( serverIface, rootPath, QStringLiteral( "OAPIF" ), QStringLiteral( "1.0.0" ) ); + auto wfs3Api = std::make_unique( serverIface, rootPath, QStringLiteral( "OAPIF" ), QStringLiteral( "1.0.0" ) ); // Register handlers wfs3Api->registerHandler(); wfs3Api->registerHandler(); diff --git a/tests/src/analysis/testqgsninecellfilters.cpp b/tests/src/analysis/testqgsninecellfilters.cpp index dde0c73ee8a..d1f229c3acb 100644 --- a/tests/src/analysis/testqgsninecellfilters.cpp +++ b/tests/src/analysis/testqgsninecellfilters.cpp @@ -226,7 +226,7 @@ void TestNineCellFilters::testCreationOptions() { QString tmpFile( tempFile( QStringLiteral( "createopts" ) ) ); - QString worldFileName = tmpFile.replace( QStringLiteral( ".tif" ), QStringLiteral( ".tfw" ) ); + QString worldFileName = tmpFile.replace( QLatin1String( ".tif" ), QLatin1String( ".tfw" ) ); QFile worldFile( worldFileName ); QVERIFY( !worldFile.exists() ); diff --git a/tests/src/analysis/testqgsprocessingcheckgeometry.cpp b/tests/src/analysis/testqgsprocessingcheckgeometry.cpp index e11e6d7ebf6..79b44a834d9 100644 --- a/tests/src/analysis/testqgsprocessingcheckgeometry.cpp +++ b/tests/src/analysis/testqgsprocessingcheckgeometry.cpp @@ -295,7 +295,7 @@ void TestQgsProcessingCheckGeometry::containedAlg() bool ok = false; QgsProcessingFeedback feedback; - std::unique_ptr< QgsProcessingContext > context = std::make_unique< QgsProcessingContext >(); + auto context = std::make_unique< QgsProcessingContext >(); QVariantMap results; results = alg->run( parameters, *context, &feedback, &ok ); @@ -324,7 +324,7 @@ void TestQgsProcessingCheckGeometry::degeneratePolygonAlg() bool ok = false; QgsProcessingFeedback feedback; - std::unique_ptr< QgsProcessingContext > context = std::make_unique< QgsProcessingContext >(); + auto context = std::make_unique< QgsProcessingContext >(); QVariantMap results; results = alg->run( parameters, *context, &feedback, &ok ); @@ -365,7 +365,7 @@ void TestQgsProcessingCheckGeometry::segmentLengthAlg() bool ok = false; QgsProcessingFeedback feedback; - std::unique_ptr< QgsProcessingContext > context = std::make_unique< QgsProcessingContext >(); + auto context = std::make_unique< QgsProcessingContext >(); QVariantMap results; results = alg->run( parameters, *context, &feedback, &ok ); @@ -404,7 +404,7 @@ void TestQgsProcessingCheckGeometry::selfIntersectionAlg() bool ok = false; QgsProcessingFeedback feedback; - std::unique_ptr< QgsProcessingContext > context = std::make_unique< QgsProcessingContext >(); + auto context = std::make_unique< QgsProcessingContext >(); QVariantMap results; results = alg->run( parameters, *context, &feedback, &ok ); @@ -433,7 +433,7 @@ void TestQgsProcessingCheckGeometry::dangleAlg() bool ok = false; QgsProcessingFeedback feedback; - std::unique_ptr< QgsProcessingContext > context = std::make_unique< QgsProcessingContext >(); + auto context = std::make_unique< QgsProcessingContext >(); QVariantMap results; results = alg->run( parameters, *context, &feedback, &ok ); @@ -473,7 +473,7 @@ void TestQgsProcessingCheckGeometry::duplicateNodesAlg() bool ok = false; QgsProcessingFeedback feedback; - std::unique_ptr< QgsProcessingContext > context = std::make_unique< QgsProcessingContext >(); + auto context = std::make_unique< QgsProcessingContext >(); QVariantMap results; results = alg->run( parameters, *context, &feedback, &ok ); @@ -507,7 +507,7 @@ void TestQgsProcessingCheckGeometry::followBoundariesAlg() bool ok = false; QgsProcessingFeedback feedback; - std::unique_ptr< QgsProcessingContext > context = std::make_unique< QgsProcessingContext >(); + auto context = std::make_unique< QgsProcessingContext >(); QVariantMap results; results = alg->run( parameters, *context, &feedback, &ok ); @@ -537,7 +537,7 @@ void TestQgsProcessingCheckGeometry::overlapAlg() bool ok = false; QgsProcessingFeedback feedback; - std::unique_ptr< QgsProcessingContext > context = std::make_unique< QgsProcessingContext >(); + auto context = std::make_unique< QgsProcessingContext >(); QVariantMap results; results = alg->run( parameters, *context, &feedback, &ok ); @@ -577,7 +577,7 @@ void TestQgsProcessingCheckGeometry::selfContactAlg() bool ok = false; QgsProcessingFeedback feedback; - std::unique_ptr< QgsProcessingContext > context = std::make_unique< QgsProcessingContext >(); + auto context = std::make_unique< QgsProcessingContext >(); QVariantMap results; results = alg->run( parameters, *context, &feedback, &ok ); @@ -608,7 +608,7 @@ void TestQgsProcessingCheckGeometry::sliverPolygonAlg() bool ok = false; QgsProcessingFeedback feedback; - std::unique_ptr< QgsProcessingContext > context = std::make_unique< QgsProcessingContext >(); + auto context = std::make_unique< QgsProcessingContext >(); QVariantMap results; results = alg->run( parameters, *context, &feedback, &ok ); @@ -632,7 +632,7 @@ void TestQgsProcessingCheckGeometry::gapAlg() const QDir testDataDir( QDir( TEST_DATA_DIR ).absoluteFilePath( "geometry_checker" ) ); QgsVectorLayer *gapLayer = new QgsVectorLayer( testDataDir.absoluteFilePath( "gap_layer.shp" ), QStringLiteral( "polygons" ), QStringLiteral( "ogr" ) ); - std::unique_ptr allowedGapsLayer = std::make_unique< QgsVectorLayer >( QStringLiteral( "Polygon?crs=epsg:4326" ), QStringLiteral( "allowedGaps" ), QStringLiteral( "memory" ) ); + auto allowedGapsLayer = std::make_unique< QgsVectorLayer >( QStringLiteral( "Polygon?crs=epsg:4326" ), QStringLiteral( "allowedGaps" ), QStringLiteral( "memory" ) ); QgsProject::instance()->addMapLayer( allowedGapsLayer.get() ); QgsFeature allowedGap; @@ -648,7 +648,7 @@ void TestQgsProcessingCheckGeometry::gapAlg() bool ok = false; QgsProcessingFeedback feedback; - std::unique_ptr< QgsProcessingContext > context = std::make_unique< QgsProcessingContext >(); + auto context = std::make_unique< QgsProcessingContext >(); QVariantMap results; results = alg->run( parameters, *context, &feedback, &ok ); @@ -688,7 +688,7 @@ void TestQgsProcessingCheckGeometry::gapAlg() bool ok = false; QgsProcessingFeedback feedback; - std::unique_ptr< QgsProcessingContext > context = std::make_unique< QgsProcessingContext >(); + auto context = std::make_unique< QgsProcessingContext >(); QVariantMap results; results = alg->run( parameters, *context, &feedback, &ok ); @@ -721,7 +721,7 @@ void TestQgsProcessingCheckGeometry::pointInPolygonAlg() bool ok = false; QgsProcessingFeedback feedback; - std::unique_ptr< QgsProcessingContext > context = std::make_unique< QgsProcessingContext >(); + auto context = std::make_unique< QgsProcessingContext >(); QVariantMap results; results = alg->run( parameters, *context, &feedback, &ok ); @@ -747,7 +747,7 @@ void TestQgsProcessingCheckGeometry::pointCoveredByLineAlg() bool ok = false; QgsProcessingFeedback feedback; - std::unique_ptr< QgsProcessingContext > context = std::make_unique< QgsProcessingContext >(); + auto context = std::make_unique< QgsProcessingContext >(); QVariantMap results; results = alg->run( parameters, *context, &feedback, &ok ); @@ -774,7 +774,7 @@ void TestQgsProcessingCheckGeometry::lineLayerIntersectionAlg() bool ok = false; QgsProcessingFeedback feedback; - std::unique_ptr< QgsProcessingContext > context = std::make_unique< QgsProcessingContext >(); + auto context = std::make_unique< QgsProcessingContext >(); QVariantMap results; results = alg->run( parameters, *context, &feedback, &ok ); @@ -803,7 +803,7 @@ void TestQgsProcessingCheckGeometry::lineIntersectionAlg() bool ok = false; QgsProcessingFeedback feedback; - std::unique_ptr< QgsProcessingContext > context = std::make_unique< QgsProcessingContext >(); + auto context = std::make_unique< QgsProcessingContext >(); QVariantMap results; results = alg->run( parameters, *context, &feedback, &ok ); @@ -843,7 +843,7 @@ void TestQgsProcessingCheckGeometry::multipartAlg() bool ok = false; QgsProcessingFeedback feedback; - std::unique_ptr< QgsProcessingContext > context = std::make_unique< QgsProcessingContext >(); + auto context = std::make_unique< QgsProcessingContext >(); QVariantMap results; results = alg->run( parameters, *context, &feedback, &ok ); diff --git a/tests/src/analysis/testqgsprocessingfixgeometry.cpp b/tests/src/analysis/testqgsprocessingfixgeometry.cpp index 4f7da339937..ea369c95cd0 100644 --- a/tests/src/analysis/testqgsprocessingfixgeometry.cpp +++ b/tests/src/analysis/testqgsprocessingfixgeometry.cpp @@ -886,4 +886,4 @@ void TestQgsProcessingFixGeometry::fixDeleteFeaturesAlg() } QGSTEST_MAIN( TestQgsProcessingFixGeometry ) -#include "testqgsprocessingfixgeometry.moc" \ No newline at end of file +#include "testqgsprocessingfixgeometry.moc" diff --git a/tests/src/analysis/testqgsrastercalculator.cpp b/tests/src/analysis/testqgsrastercalculator.cpp index 32df48aebcd..36100c95ef6 100644 --- a/tests/src/analysis/testqgsrastercalculator.cpp +++ b/tests/src/analysis/testqgsrastercalculator.cpp @@ -1152,7 +1152,7 @@ void TestQgsRasterCalculator::testCreationOptions() QString tmpName = tmpFile.fileName(); tmpFile.close(); - QString worldFileName = tmpName.replace( QStringLiteral( ".tif" ), QStringLiteral( ".tfw" ) ); + QString worldFileName = tmpName.replace( QLatin1String( ".tif" ), QLatin1String( ".tfw" ) ); QFile worldFile( worldFileName ); QVERIFY( !worldFile.exists() ); diff --git a/tests/src/core/geometry/testqgssfcgal.cpp b/tests/src/core/geometry/testqgssfcgal.cpp index 631775f76f4..e2a933379f5 100644 --- a/tests/src/core/geometry/testqgssfcgal.cpp +++ b/tests/src/core/geometry/testqgssfcgal.cpp @@ -425,7 +425,7 @@ void TestQgsSfcgal::isEqual() void TestQgsSfcgal::boundary() { // 2D line - std::unique_ptr sfcgalLine2D = std::make_unique( mpPolylineGeometryD ); + auto sfcgalLine2D = std::make_unique( mpPolylineGeometryD ); #if SFCGAL_VERSION_MAJOR_INT == 2 && SFCGAL_VERSION_MINOR_INT < 1 QVERIFY_EXCEPTION_THROWN( sfcgalLine2D->boundary(), QgsNotSupportedException ); #else @@ -435,7 +435,7 @@ void TestQgsSfcgal::boundary() #endif // 3D polygon - std::unique_ptr sfcgalPolygon3D = std::make_unique( mSfcgalPolygonZA ); + auto sfcgalPolygon3D = std::make_unique( mSfcgalPolygonZA ); #if SFCGAL_VERSION_MAJOR_INT == 2 && SFCGAL_VERSION_MINOR_INT < 1 QVERIFY_EXCEPTION_THROWN( sfcgalPolygon3D->boundary(), QgsNotSupportedException ); #else @@ -448,16 +448,16 @@ void TestQgsSfcgal::boundary() void TestQgsSfcgal::centroid() { - std::unique_ptr geomZA = std::make_unique( mSfcgalPolygonZA ); - std::unique_ptr geomZB = std::make_unique( mSfcgalPolygonZB ); - std::unique_ptr geomZC = std::make_unique( mSfcgalPolygonZC ); + auto geomZA = std::make_unique( mSfcgalPolygonZA ); + auto geomZB = std::make_unique( mSfcgalPolygonZB ); + auto geomZC = std::make_unique( mSfcgalPolygonZC ); #if SFCGAL_VERSION_MAJOR_INT == 2 && SFCGAL_VERSION_MINOR_INT < 1 QVERIFY_EXCEPTION_THROWN( geomZA->centroid(), QgsNotSupportedException ); QVERIFY_EXCEPTION_THROWN( geomZB->centroid(), QgsNotSupportedException ); QVERIFY_EXCEPTION_THROWN( geomZC->centroid(), QgsNotSupportedException ); #else - std::unique_ptr res = std::make_unique( geomZA->centroid() ); + auto res = std::make_unique( geomZA->centroid() ); QCOMPARE( res->asWkt( 2 ), QStringLiteral( "Point Z (-5673.79 3594.8 20)" ) ); res = std::make_unique( geomZB->centroid() ); @@ -471,7 +471,7 @@ void TestQgsSfcgal::centroid() void TestQgsSfcgal::dropZ() { // PolygonZ - std::unique_ptr sfcgalPolygonZ = std::make_unique( mSfcgalPolygonZA ); + auto sfcgalPolygonZ = std::make_unique( mSfcgalPolygonZA ); QCOMPARE( sfcgalPolygonZ->wkbType(), Qgis::WkbType::PolygonZ ); #if SFCGAL_VERSION_MAJOR_INT == 2 && SFCGAL_VERSION_MINOR_INT < 1 QVERIFY_EXCEPTION_THROWN( sfcgalPolygonZ->dropZValue(), QgsNotSupportedException ); @@ -482,7 +482,7 @@ void TestQgsSfcgal::dropZ() QVERIFY( !sfcgalPolygonZ->dropZValue() ); // Polygon2D - std::unique_ptr sfcgalPolygon2D = std::make_unique( QgsGeometry::fromPolygonXY( mPolygonA ) ); + auto sfcgalPolygon2D = std::make_unique( QgsGeometry::fromPolygonXY( mPolygonA ) ); QCOMPARE( sfcgalPolygon2D->wkbType(), Qgis::WkbType::Polygon ); QVERIFY( !sfcgalPolygon2D->dropZValue() ); QCOMPARE( sfcgalPolygon2D->wkbType(), Qgis::WkbType::Polygon ); @@ -506,7 +506,7 @@ void TestQgsSfcgal::dropZ() void TestQgsSfcgal::dropM() { // PolygonZ - std::unique_ptr sfcgalPolygonZ = std::make_unique( mSfcgalPolygonZA ); + auto sfcgalPolygonZ = std::make_unique( mSfcgalPolygonZA ); QCOMPARE( sfcgalPolygonZ->wkbType(), Qgis::WkbType::PolygonZ ); #if SFCGAL_VERSION_MAJOR_INT == 2 && SFCGAL_VERSION_MINOR_INT < 1 QVERIFY_EXCEPTION_THROWN( sfcgalPolygonZ->dropMValue(), QgsNotSupportedException ); @@ -515,7 +515,7 @@ void TestQgsSfcgal::dropM() QCOMPARE( sfcgalPolygonZ->wkbType(), Qgis::WkbType::PolygonZ ); // Polygon2D - std::unique_ptr sfcgalPolygon2D = std::make_unique( QgsGeometry::fromPolygonXY( mPolygonA ) ); + auto sfcgalPolygon2D = std::make_unique( QgsGeometry::fromPolygonXY( mPolygonA ) ); QCOMPARE( sfcgalPolygon2D->wkbType(), Qgis::WkbType::Polygon ); QVERIFY( !sfcgalPolygon2D->dropMValue() ); QCOMPARE( sfcgalPolygon2D->wkbType(), Qgis::WkbType::Polygon ); @@ -620,7 +620,7 @@ void TestQgsSfcgal::swapXY() void TestQgsSfcgal::isEmpty() { - std::unique_ptr sfcgalGeomZA = std::make_unique( mSfcgalPolygonZA ); + auto sfcgalGeomZA = std::make_unique( mSfcgalPolygonZA ); QVERIFY( !sfcgalGeomZA->isEmpty() ); QgsSfcgalGeometry sfcgalGeomEmpty( "POLYGON EMPTY" ); @@ -648,7 +648,7 @@ void TestQgsSfcgal::scale() QCOMPARE( sfcgalScalePoint3DCenter->asWkt( 0 ), QStringLiteral( "POINT Z (7 7 2)" ) ); // 3D Polygon - no center - std::unique_ptr sfcgalPolygonA = std::make_unique( mSfcgalPolygonZA ); + auto sfcgalPolygonA = std::make_unique( mSfcgalPolygonZA ); const QgsVector3D scaleFactorPolygon( 2, 2, 2 ); std::unique_ptr sfcgalScalePolygonA( sfcgalPolygonA->scale( scaleFactorPolygon, QgsPoint() ) ); @@ -666,7 +666,7 @@ void TestQgsSfcgal::scale() QVERIFY2( expectedScalePolygonACenter.covers( *sfcgalScalePolygonACenter.get() ), "scale polygon A with center does not match expected WKT" ); // 2D LineString - no center - std::unique_ptr sfcgalLineD = std::make_unique( mpPolylineGeometryD ); + auto sfcgalLineD = std::make_unique( mpPolylineGeometryD ); const QgsVector3D scaleFactorLine( 3, 2, 0 ); std::unique_ptr sfcgalScaleLineD( sfcgalLineD->scale( scaleFactorLine, QgsPoint() ) ); @@ -706,9 +706,9 @@ void TestQgsSfcgal::intersection3d() initPainterTest(); // first triangulate polygon as some are not coplanar - std::unique_ptr geomZA = std::make_unique( mSfcgalPolygonZA ); - std::unique_ptr geomZB = std::make_unique( mSfcgalPolygonZB ); - std::unique_ptr geomZC = std::make_unique( mSfcgalPolygonZC ); + auto geomZA = std::make_unique( mSfcgalPolygonZA ); + auto geomZB = std::make_unique( mSfcgalPolygonZB ); + auto geomZC = std::make_unique( mSfcgalPolygonZC ); geomZA = geomZA->triangulate(); geomZB = geomZB->triangulate(); @@ -803,7 +803,7 @@ void TestQgsSfcgal::unionCheck1() { initPainterTest(); // should be a multipolygon with 2 parts as A does not intersect C - std::unique_ptr geomA = std::make_unique( mpPolygonGeometryA ); + auto geomA = std::make_unique( mpPolygonGeometryA ); QVector geomList; geomList.append( mpPolygonGeometryC.get() ); @@ -827,7 +827,7 @@ void TestQgsSfcgal::unionCheck2() { initPainterTest(); // should be a single polygon as A intersect B - std::unique_ptr geomA = std::make_unique( mpPolygonGeometryA ); + auto geomA = std::make_unique( mpPolygonGeometryA ); QVector geomList; geomList.append( mpPolygonGeometryB.get() ); @@ -851,7 +851,7 @@ void TestQgsSfcgal::differenceCheck1() { initPainterTest(); // should be same as A since A does not intersect C so diff is 100% of A - std::unique_ptr geomA = std::make_unique( mpPolygonGeometryA ); + auto geomA = std::make_unique( mpPolygonGeometryA ); std::unique_ptr diffGeom = geomA->difference( mpPolygonGeometryC.constGet() ); QCOMPARE( diffGeom->wkbType(), Qgis::WkbType::Polygon ); @@ -869,7 +869,7 @@ void TestQgsSfcgal::differenceCheck2() { initPainterTest(); // should be a single polygon as (A - B) = subset of A - std::unique_ptr geomA = std::make_unique( mpPolygonGeometryA ); + auto geomA = std::make_unique( mpPolygonGeometryA ); std::unique_ptr diffGeom = geomA->difference( mpPolygonGeometryB.constGet() ); QCOMPARE( diffGeom->wkbType(), Qgis::WkbType::Polygon ); @@ -935,7 +935,7 @@ void TestQgsSfcgal::buffer3DCheck() "116.868555 35.534051, 116.617007 35.869448, 116.491233 35.953297, " "116.155836 36.288694, 116.071987 36.372544, 115.443117 36.749865, " "114.814247 37.043338, 114.311152 37.169112)"; - std::unique_ptr sfcgalLine2D = std::make_unique( sfcgalLine2DWkt ); + auto sfcgalLine2D = std::make_unique( sfcgalLine2DWkt ); std::unique_ptr sfcgalBuffer3D( sfcgalLine2D->buffer3D( 20.0, 7, Qgis::JoinStyle3D::Round ) ); QVERIFY2( sfcgalBuffer3D != nullptr, "buffer 3d is NULL." ); @@ -966,7 +966,7 @@ void TestQgsSfcgal::buffer3DCheck() void TestQgsSfcgal::buffer2DCheck() { - std::unique_ptr sfcgalLine2D = std::make_unique( mpPolygonGeometryA ); + auto sfcgalLine2D = std::make_unique( mpPolygonGeometryA ); std::unique_ptr sfcgalBuffer2D( sfcgalLine2D->buffer2D( 20.0, 7, Qgis::JoinStyle::Round ) ); QVERIFY2( sfcgalBuffer2D != nullptr, "2D Buffer is NULL" ); @@ -979,7 +979,7 @@ void TestQgsSfcgal::buffer2DCheck() void TestQgsSfcgal::extrude() { - std::unique_ptr sfcgalPolygonA = std::make_unique( mSfcgalPolygonZA ); + auto sfcgalPolygonA = std::make_unique( mSfcgalPolygonZA ); const QgsVector3D extrusion( 0, 0, 30 ); std::unique_ptr sfcgalExtrusion( sfcgalPolygonA->extrude( extrusion ) ); diff --git a/tests/src/core/testqgsgdalutils.cpp b/tests/src/core/testqgsgdalutils.cpp index 2d3a4a9616b..7ad7b960d80 100644 --- a/tests/src/core/testqgsgdalutils.cpp +++ b/tests/src/core/testqgsgdalutils.cpp @@ -340,7 +340,7 @@ void TestQgsGdalUtils::testResampleSingleBandRasterNoData() QCOMPARE( err, CE_None ); // Create destination GDAL DS - std::unique_ptr dstBlock = std::make_unique( Qgis::DataType::UInt16, 4, 4 ); + auto dstBlock = std::make_unique( Qgis::DataType::UInt16, 4, 4 ); dstBlock->setNoDataValue( 65535.0 ); gdal::dataset_unique_ptr gdalDsOutput = QgsGdalUtils::blockToSingleBandMemoryDataset( QgsRectangle( 1, 1, 3, 3 ), dstBlock.get() ); diff --git a/tests/src/core/testqgslayertree.cpp b/tests/src/core/testqgslayertree.cpp index 35dd9472140..1db47b90196 100644 --- a/tests/src/core/testqgslayertree.cpp +++ b/tests/src/core/testqgslayertree.cpp @@ -834,7 +834,7 @@ void TestQgsLayerTree::testFindNestedGroups() void TestQgsLayerTree::testCustomNodes() { - std::unique_ptr< QgsLayerTreeCustomNode > custom = std::make_unique< QgsLayerTreeCustomNode >( QStringLiteral( "custom-id" ) ); + auto custom = std::make_unique< QgsLayerTreeCustomNode >( QStringLiteral( "custom-id" ) ); QVERIFY( QgsLayerTree::isCustomNode( custom.get() ) ); QCOMPARE( custom->nodeId(), QStringLiteral( "custom-id" ) ); QCOMPARE( custom->name(), QStringLiteral( "custom-id" ) ); diff --git a/tests/src/gui/testqgsattributeform.cpp b/tests/src/gui/testqgsattributeform.cpp index 542936f601c..8a3136953f6 100644 --- a/tests/src/gui/testqgsattributeform.cpp +++ b/tests/src/gui/testqgsattributeform.cpp @@ -1279,7 +1279,7 @@ void TestQgsAttributeForm::testFieldConstraintDuplicateField() void TestQgsAttributeForm::testCaseInsensitiveFieldConstraint() { - std::unique_ptr layer = std::make_unique( QStringLiteral( "Point?field=f1:integer&field=f2:integer&field=f3:integer" ), QStringLiteral( "test" ), QStringLiteral( "memory" ) ); + auto layer = std::make_unique( QStringLiteral( "Point?field=f1:integer&field=f2:integer&field=f3:integer" ), QStringLiteral( "test" ), QStringLiteral( "memory" ) ); layer->setEditorWidgetSetup( 0, QgsEditorWidgetSetup( QStringLiteral( "TextEdit" ), QVariantMap() ) ); layer->setEditorWidgetSetup( 1, QgsEditorWidgetSetup( QStringLiteral( "TextEdit" ), QVariantMap() ) ); diff --git a/tests/src/gui/testqgsattributesformmodel.cpp b/tests/src/gui/testqgsattributesformmodel.cpp index 6f78ddfccee..800a6e0dd81 100644 --- a/tests/src/gui/testqgsattributesformmodel.cpp +++ b/tests/src/gui/testqgsattributesformmodel.cpp @@ -94,7 +94,7 @@ void TestQgsAttributesFormModel::cleanup() void TestQgsAttributesFormModel::testAttributesFormItem() { // Default constructor (used for the root item) - std::unique_ptr< QgsAttributesFormItem > rootItem = std::make_unique< QgsAttributesFormItem >(); + auto rootItem = std::make_unique< QgsAttributesFormItem >(); QVERIFY( rootItem->data( QgsAttributesFormModel::ItemIdRole ).toString().isEmpty() ); QVERIFY( rootItem->data( QgsAttributesFormModel::ItemNameRole ).toString().isEmpty() ); QVERIFY( rootItem->data( QgsAttributesFormModel::ItemDisplayRole ).toString().isEmpty() ); @@ -105,7 +105,7 @@ void TestQgsAttributesFormModel::testAttributesFormItem() // Second constructor const QString item1Name = QStringLiteral( "child item1 name" ); const QString item1DisplayName = QStringLiteral( "child item1 display name" ); - std::unique_ptr< QgsAttributesFormItem > item = std::make_unique< QgsAttributesFormItem >( QgsAttributesFormData::Field, item1Name, item1DisplayName ); + auto item = std::make_unique< QgsAttributesFormItem >( QgsAttributesFormData::Field, item1Name, item1DisplayName ); QVERIFY( !item->parent() ); QCOMPARE( item->data( QgsAttributesFormModel::ItemNameRole ).toString(), item1Name ); QCOMPARE( item->data( QgsAttributesFormModel::ItemDisplayRole ).toString(), item1DisplayName ); @@ -138,7 +138,7 @@ void TestQgsAttributesFormModel::testAttributesFormItem() QgsAttributesFormData::AttributeFormItemData itemData; itemData.setShowLabel( false ); - std::unique_ptr< QgsAttributesFormItem > item2 = std::make_unique< QgsAttributesFormItem >( QgsAttributesFormData::Field, itemData, item2Name, item2DisplayName, rootItem.get() ); + auto item2 = std::make_unique< QgsAttributesFormItem >( QgsAttributesFormData::Field, itemData, item2Name, item2DisplayName, rootItem.get() ); QVERIFY( item2->parent() ); QCOMPARE( item2->data( QgsAttributesFormModel::ItemNameRole ).toString(), item2Name ); QCOMPARE( item2->data( QgsAttributesFormModel::ItemDisplayRole ).toString(), item2DisplayName ); @@ -162,12 +162,12 @@ void TestQgsAttributesFormModel::testAttributesFormItem() // Add container and grandchild const QString containerName = QStringLiteral( "Tab" ); - std::unique_ptr< QgsAttributesFormItem > containerItem = std::make_unique< QgsAttributesFormItem >( QgsAttributesFormData::Container, containerName ); + auto containerItem = std::make_unique< QgsAttributesFormItem >( QgsAttributesFormData::Container, containerName ); QCOMPARE( containerItem->childCount(), 0 ); containerItem->setData( QgsAttributesFormModel::ItemIdRole, containerName ); const QString relationName = QStringLiteral( "Relation item" ); - std::unique_ptr< QgsAttributesFormItem > relationItem = std::make_unique< QgsAttributesFormItem >( QgsAttributesFormData::Relation, relationName ); + auto relationItem = std::make_unique< QgsAttributesFormItem >( QgsAttributesFormData::Relation, relationName ); const QString relationId = QStringLiteral( "relationId" ); relationItem->setData( QgsAttributesFormModel::ItemIdRole, relationId ); diff --git a/tests/src/gui/testqgsscalecombobox.cpp b/tests/src/gui/testqgsscalecombobox.cpp index 4eaf22be287..5e2f8d121d0 100644 --- a/tests/src/gui/testqgsscalecombobox.cpp +++ b/tests/src/gui/testqgsscalecombobox.cpp @@ -135,7 +135,7 @@ void TestQgsScaleComboBox::basic() void TestQgsScaleComboBox::flexible() { - std::unique_ptr< QgsScaleComboBox > combo = std::make_unique< QgsScaleComboBox >(); + auto combo = std::make_unique< QgsScaleComboBox >(); combo->setRatioMode( QgsScaleComboBox::RatioMode::Flexible ); const QStringList scales = QgsSettingsRegistryCore::settingsMapScales->value();