diff --git a/src/core/elevation/qgsabstractprofilesurfacegenerator.cpp b/src/core/elevation/qgsabstractprofilesurfacegenerator.cpp index 9ec3a9f9b0b..d23e2f33ddc 100644 --- a/src/core/elevation/qgsabstractprofilesurfacegenerator.cpp +++ b/src/core/elevation/qgsabstractprofilesurfacegenerator.cpp @@ -232,7 +232,7 @@ QVector QgsAbstractProfileSurfaceResults::identify( c prevElevation = it.value(); } if ( result.has_value() ) - return {result.value()}; + return {*result}; else return {}; } diff --git a/src/core/labeling/qgstextlabelfeature.h b/src/core/labeling/qgstextlabelfeature.h index e5fb5ffab4d..88337cead4d 100644 --- a/src/core/labeling/qgstextlabelfeature.h +++ b/src/core/labeling/qgstextlabelfeature.h @@ -83,7 +83,7 @@ class CORE_EXPORT QgsTextLabelFeature : public QgsLabelFeature * \see setTextMetrics() * \since QGIS 3.20 */ - const QgsPrecalculatedTextMetrics *textMetrics() const { return mTextMetrics.has_value() ? &mTextMetrics.value() : nullptr; } + const QgsPrecalculatedTextMetrics *textMetrics() const { return mTextMetrics.has_value() ? &( *mTextMetrics ) : nullptr; } /** * Sets additional text \a metrics required for curved label placement. diff --git a/src/core/pointcloud/qgspointclouddataprovider.cpp b/src/core/pointcloud/qgspointclouddataprovider.cpp index ddcba70b738..08bcc8ab7d9 100644 --- a/src/core/pointcloud/qgspointclouddataprovider.cpp +++ b/src/core/pointcloud/qgspointclouddataprovider.cpp @@ -264,7 +264,7 @@ struct MapIndexedPointCloudNode // here we check the flag set in header to determine if we need to // parse the time as GPS week time or GPS adjusted standard time // however often times the flag is set wrong, so we determine if the value is bigger than the maximum amount of seconds in week then it has to be adjusted standard time - if ( copcTimeFlag.value() || pointAttr[QStringLiteral( "GpsTime" )].toDouble() > numberOfSecsInWeek ) + if ( *copcTimeFlag || pointAttr[QStringLiteral( "GpsTime" )].toDouble() > numberOfSecsInWeek ) { const QString utcTime = gpsBaseTime.addSecs( static_cast( pointAttr[QStringLiteral( "GpsTime" )].toDouble() + 1e9 ) ).toString( Qt::ISODate ); pointAttr[ QStringLiteral( "GpsTime (raw)" )] = pointAttr[QStringLiteral( "GpsTime" )]; diff --git a/src/core/settings/qgssettingsproxy.h b/src/core/settings/qgssettingsproxy.h index 32ef08dfbfc..32c68871b40 100644 --- a/src/core/settings/qgssettingsproxy.h +++ b/src/core/settings/qgssettingsproxy.h @@ -48,7 +48,7 @@ class CORE_EXPORT QgsSettingsProxy */ QgsSettings *operator->() { - return mOwnedSettings.has_value() ? &( mOwnedSettings.value() ) : mNonOwnedSettings; + return mOwnedSettings.has_value() ? &( *mOwnedSettings ) : mNonOwnedSettings; } /** @@ -56,7 +56,7 @@ class CORE_EXPORT QgsSettingsProxy */ QgsSettings &operator* () { - return mOwnedSettings.has_value() ? mOwnedSettings.value() : *mNonOwnedSettings; + return mOwnedSettings.has_value() ? *mOwnedSettings : *mNonOwnedSettings; } private: