From c8156b01066107b91121417e423dee4a299affc3 Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Fri, 2 Jul 2021 08:39:20 +1000 Subject: [PATCH] Add c++20 todo for replacing equality operators with default implementations --- .../vector/geometry_checker/qgsgeometrycheck.sip.in | 1 + python/core/auto_generated/auth/qgsauthconfig.sip.in | 1 + python/core/auto_generated/editform/qgseditformconfig.sip.in | 1 - python/core/auto_generated/geometry/qgslinesegment.sip.in | 1 + python/core/auto_generated/qgsdefaultvalue.sip.in | 1 + python/core/auto_generated/qgsmaplayerdependency.sip.in | 1 + python/core/auto_generated/qgsreadwritecontext.sip.in | 1 + .../auto_generated/symbology/qgssymbollayerreference.sip.in | 1 + src/3d/chunks/qgschunknode_p.h | 1 + src/3d/materials/qgsgoochmaterialsettings.h | 1 + src/3d/materials/qgsphongmaterialsettings.h | 1 + src/3d/materials/qgsphongtexturedmaterialsettings.h | 1 + src/3d/materials/qgssimplelinematerialsettings.h | 1 + src/3d/qgscamerapose.h | 1 + src/3d/qgsdirectionallightsettings.h | 1 + src/3d/qgspointlightsettings.h | 1 + src/3d/qgsraycastingutils_p.h | 1 + src/analysis/interpolation/Vector3D.h | 1 + src/analysis/vector/geometry_checker/qgsgeometrycheck.h | 2 ++ src/app/vertextool/qgsvertextool.h | 1 + src/core/auth/qgsauthconfig.h | 2 ++ src/core/editform/qgseditformconfig.h | 2 +- src/core/geometry/qgsgeometry.h | 1 + src/core/geometry/qgslinesegment.h | 2 ++ src/core/metadata/qgsabstractmetadatabase.h | 3 +++ src/core/metadata/qgslayermetadata.h | 3 +++ src/core/pointcloud/qgspointcloudindex.h | 2 ++ src/core/processing/models/qgsprocessingmodelchilddependency.h | 1 + src/core/processing/qgsprocessingparameters.h | 2 ++ src/core/proj/qgscoordinatetransformcontext_p.h | 1 + src/core/proj/qgsdatumtransform.h | 1 + src/core/providers/qgsabstractdatabaseproviderconnection.h | 1 + src/core/providers/qgsprovidersublayerdetails.h | 1 + src/core/qgsattributetableconfig.h | 1 + src/core/qgsbookmarkmanager.h | 1 + src/core/qgsdefaultvalue.h | 2 ++ src/core/qgsfield_p.h | 1 + src/core/qgsfieldconstraints.h | 1 + src/core/qgsfields.h | 2 ++ src/core/qgsmaplayerdependency.h | 2 ++ src/core/qgsmapthemecollection.h | 1 + src/core/qgspointlocator.h | 1 + src/core/qgsreadwritecontext.h | 2 ++ src/core/qgsremappingproxyfeaturesink.h | 1 + src/core/qgssnappingconfig.h | 1 + src/core/qgssnappingutils.h | 1 + src/core/qgstemporalutils.h | 3 ++- src/core/qgsvector3d.h | 1 + src/core/symbology/qgssymbollayerreference.h | 2 ++ 49 files changed, 63 insertions(+), 3 deletions(-) diff --git a/python/analysis/auto_generated/vector/geometry_checker/qgsgeometrycheck.sip.in b/python/analysis/auto_generated/vector/geometry_checker/qgsgeometrycheck.sip.in index 6465c4a6596..caeb63b254a 100644 --- a/python/analysis/auto_generated/vector/geometry_checker/qgsgeometrycheck.sip.in +++ b/python/analysis/auto_generated/vector/geometry_checker/qgsgeometrycheck.sip.in @@ -132,6 +132,7 @@ Create a new Change QgsGeometryCheck::ChangeType type; QgsVertexId vidx; + bool operator==( const QgsGeometryCheck::Change &other ); }; diff --git a/python/core/auto_generated/auth/qgsauthconfig.sip.in b/python/core/auto_generated/auth/qgsauthconfig.sip.in index 86a07656238..84d51f4fc5a 100644 --- a/python/core/auto_generated/auth/qgsauthconfig.sip.in +++ b/python/core/auto_generated/auth/qgsauthconfig.sip.in @@ -31,6 +31,7 @@ Construct a configuration for an authentication method :param version: Version of the configuration (for updating previously saved configs later on) %End + bool operator==( const QgsAuthMethodConfig &other ) const; bool operator!=( const QgsAuthMethodConfig &other ) const; diff --git a/python/core/auto_generated/editform/qgseditformconfig.sip.in b/python/core/auto_generated/editform/qgseditformconfig.sip.in index bcba28cb2e7..267208b1edf 100644 --- a/python/core/auto_generated/editform/qgseditformconfig.sip.in +++ b/python/core/auto_generated/editform/qgseditformconfig.sip.in @@ -85,7 +85,6 @@ Copy constructor %End ~QgsEditFormConfig(); - bool operator==( const QgsEditFormConfig &o ); void addTab( QgsAttributeEditorElement *data /Transfer/ ); diff --git a/python/core/auto_generated/geometry/qgslinesegment.sip.in b/python/core/auto_generated/geometry/qgslinesegment.sip.in index 3dcaf471c59..a3b8b6268e9 100644 --- a/python/core/auto_generated/geometry/qgslinesegment.sip.in +++ b/python/core/auto_generated/geometry/qgslinesegment.sip.in @@ -191,6 +191,7 @@ on the line, or exactly in line with the segment) and the result is undefined. Reverses the line segment, so that the start and end points are flipped. %End + bool operator==( const QgsLineSegment2D &other ) const /HoldGIL/; bool operator!=( const QgsLineSegment2D &other ) const /HoldGIL/; diff --git a/python/core/auto_generated/qgsdefaultvalue.sip.in b/python/core/auto_generated/qgsdefaultvalue.sip.in index ad46881360c..5627540f00c 100644 --- a/python/core/auto_generated/qgsdefaultvalue.sip.in +++ b/python/core/auto_generated/qgsdefaultvalue.sip.in @@ -44,6 +44,7 @@ Create a new default value with the given ``expression`` and ``applyOnUpdate`` f .. seealso:: :py:func:`QgsVectorLayer.setDefaultValueDefinition` %End + bool operator==( const QgsDefaultValue &other ) const; QString expression() const; diff --git a/python/core/auto_generated/qgsmaplayerdependency.sip.in b/python/core/auto_generated/qgsmaplayerdependency.sip.in index dd5f2d14b34..bfe2cecaa2e 100644 --- a/python/core/auto_generated/qgsmaplayerdependency.sip.in +++ b/python/core/auto_generated/qgsmaplayerdependency.sip.in @@ -60,6 +60,7 @@ Returns the dependency origin Returns the ID of the layer this dependency depends on %End + bool operator==( const QgsMapLayerDependency &other ) const; //! hash operator diff --git a/python/core/auto_generated/qgsreadwritecontext.sip.in b/python/core/auto_generated/qgsreadwritecontext.sip.in index cf2be3b3475..cbfca523506 100644 --- a/python/core/auto_generated/qgsreadwritecontext.sip.in +++ b/python/core/auto_generated/qgsreadwritecontext.sip.in @@ -45,6 +45,7 @@ Returns the message level Returns the stack of categories of the message %End + bool operator==( const QgsReadWriteContext::ReadWriteMessage &other ) const; bool operator!=( const QgsReadWriteContext::ReadWriteMessage &other ) const; diff --git a/python/core/auto_generated/symbology/qgssymbollayerreference.sip.in b/python/core/auto_generated/symbology/qgssymbollayerreference.sip.in index 47d6e560b4c..0fe3dc5591b 100644 --- a/python/core/auto_generated/symbology/qgssymbollayerreference.sip.in +++ b/python/core/auto_generated/symbology/qgssymbollayerreference.sip.in @@ -69,6 +69,7 @@ Returns the key associated to the symbol Returns the symbol layer index path inside the symbol %End + bool operator==( const QgsSymbolLayerId &other ) const; bool operator<( const QgsSymbolLayerId &other ) const; diff --git a/src/3d/chunks/qgschunknode_p.h b/src/3d/chunks/qgschunknode_p.h index d9dc2cf9f75..1fff7f2349a 100644 --- a/src/3d/chunks/qgschunknode_p.h +++ b/src/3d/chunks/qgschunknode_p.h @@ -68,6 +68,7 @@ struct QgsChunkNodeId return QStringLiteral( "%1/%2/%3/%4" ).arg( d ).arg( x ).arg( y ).arg( z ); // octree } + // TODO c++20 - replace with = default bool operator==( const QgsChunkNodeId &other ) const { return d == other.d && x == other.x && y == other.y && z == other.z; diff --git a/src/3d/materials/qgsgoochmaterialsettings.h b/src/3d/materials/qgsgoochmaterialsettings.h index 3e84b4203cb..9d4da3c7131 100644 --- a/src/3d/materials/qgsgoochmaterialsettings.h +++ b/src/3d/materials/qgsgoochmaterialsettings.h @@ -108,6 +108,7 @@ class _3D_EXPORT QgsGoochMaterialSettings : public QgsAbstractMaterialSettings #endif + // TODO c++20 - replace with = default bool operator==( const QgsGoochMaterialSettings &other ) const { return mDiffuse == other.mDiffuse && diff --git a/src/3d/materials/qgsphongmaterialsettings.h b/src/3d/materials/qgsphongmaterialsettings.h index dd919c98185..6eccd85bbfa 100644 --- a/src/3d/materials/qgsphongmaterialsettings.h +++ b/src/3d/materials/qgsphongmaterialsettings.h @@ -96,6 +96,7 @@ class _3D_EXPORT QgsPhongMaterialSettings : public QgsAbstractMaterialSettings void applyDataDefinedToGeometry( Qt3DRender::QGeometry *geometry, int vertexCount, const QByteArray &data ) const override; #endif + // TODO c++20 - replace with = default bool operator==( const QgsPhongMaterialSettings &other ) const { return mAmbient == other.mAmbient && diff --git a/src/3d/materials/qgsphongtexturedmaterialsettings.h b/src/3d/materials/qgsphongtexturedmaterialsettings.h index 5cd6dead1ba..b01e3115cfd 100644 --- a/src/3d/materials/qgsphongtexturedmaterialsettings.h +++ b/src/3d/materials/qgsphongtexturedmaterialsettings.h @@ -120,6 +120,7 @@ class _3D_EXPORT QgsPhongTexturedMaterialSettings : public QgsAbstractMaterialSe void addParametersToEffect( Qt3DRender::QEffect *effect ) const override; #endif + // TODO c++20 - replace with = default bool operator==( const QgsPhongTexturedMaterialSettings &other ) const { return mAmbient == other.mAmbient && diff --git a/src/3d/materials/qgssimplelinematerialsettings.h b/src/3d/materials/qgssimplelinematerialsettings.h index e8b4b994e1a..b7962bad4a0 100644 --- a/src/3d/materials/qgssimplelinematerialsettings.h +++ b/src/3d/materials/qgssimplelinematerialsettings.h @@ -78,6 +78,7 @@ class _3D_EXPORT QgsSimpleLineMaterialSettings : public QgsAbstractMaterialSetti void addParametersToEffect( Qt3DRender::QEffect *effect ) const override; #endif + // TODO c++20 - replace with = default bool operator==( const QgsSimpleLineMaterialSettings &other ) const { return mAmbient == other.mAmbient; diff --git a/src/3d/qgscamerapose.h b/src/3d/qgscamerapose.h index 83cfebbcb02..e7caa80f71e 100644 --- a/src/3d/qgscamerapose.h +++ b/src/3d/qgscamerapose.h @@ -75,6 +75,7 @@ class _3D_EXPORT QgsCameraPose //! Reads configuration from a DOM element previously written using writeXml() void readXml( const QDomElement &elem ); + // TODO c++20 - replace with = default bool operator==( const QgsCameraPose &other ) const { return mCenterPoint == other.mCenterPoint && diff --git a/src/3d/qgsdirectionallightsettings.h b/src/3d/qgsdirectionallightsettings.h index 5d389f54adc..99f95e5850e 100644 --- a/src/3d/qgsdirectionallightsettings.h +++ b/src/3d/qgsdirectionallightsettings.h @@ -55,6 +55,7 @@ class _3D_EXPORT QgsDirectionalLightSettings //! Reads configuration from a DOM element previously written using writeXml() void readXml( const QDomElement &elem ); + // TODO c++20 - replace with = default bool operator==( const QgsDirectionalLightSettings &other ); private: diff --git a/src/3d/qgspointlightsettings.h b/src/3d/qgspointlightsettings.h index 2ee5b8502c8..1caf76318b1 100644 --- a/src/3d/qgspointlightsettings.h +++ b/src/3d/qgspointlightsettings.h @@ -76,6 +76,7 @@ class _3D_EXPORT QgsPointLightSettings //! Reads configuration from a DOM element previously written using writeXml() void readXml( const QDomElement &elem ); + // TODO c++20 - replace with = default bool operator==( const QgsPointLightSettings &other ); private: diff --git a/src/3d/qgsraycastingutils_p.h b/src/3d/qgsraycastingutils_p.h index 9c75162a456..8dba524f829 100644 --- a/src/3d/qgsraycastingutils_p.h +++ b/src/3d/qgsraycastingutils_p.h @@ -75,6 +75,7 @@ namespace QgsRayCastingUtils Ray3D &transform( const QMatrix4x4 &matrix ); Ray3D transformed( const QMatrix4x4 &matrix ) const; + // TODO c++20 - replace with = default bool operator==( const Ray3D &other ) const; bool operator!=( const Ray3D &other ) const; diff --git a/src/analysis/interpolation/Vector3D.h b/src/analysis/interpolation/Vector3D.h index b490d817d95..aae44b60067 100644 --- a/src/analysis/interpolation/Vector3D.h +++ b/src/analysis/interpolation/Vector3D.h @@ -48,6 +48,7 @@ class ANALYSIS_EXPORT Vector3D //! Default constructor Vector3D() = default; + // TODO c++20 - replace with = default bool operator==( const Vector3D &v ) const; bool operator!=( const Vector3D &v ) const; //! Returns the x-component of the vector diff --git a/src/analysis/vector/geometry_checker/qgsgeometrycheck.h b/src/analysis/vector/geometry_checker/qgsgeometrycheck.h index 420f53bafa5..d0c5bb45377 100644 --- a/src/analysis/vector/geometry_checker/qgsgeometrycheck.h +++ b/src/analysis/vector/geometry_checker/qgsgeometrycheck.h @@ -200,6 +200,8 @@ class ANALYSIS_EXPORT QgsGeometryCheck * The index of the part / ring / vertex, depending on \see what. */ QgsVertexId vidx; + + // TODO c++20 - replace with = default bool operator==( const QgsGeometryCheck::Change &other ) { return what == other.what && type == other.type && vidx == other.vidx; diff --git a/src/app/vertextool/qgsvertextool.h b/src/app/vertextool/qgsvertextool.h index b755dd8bb6d..9a637693b55 100644 --- a/src/app/vertextool/qgsvertextool.h +++ b/src/app/vertextool/qgsvertextool.h @@ -42,6 +42,7 @@ struct Vertex , fid( fid ) , vertexId( vertexId ) {} + // TODO c++20 - replace with = default bool operator==( const Vertex &other ) const { return layer == other.layer && fid == other.fid && vertexId == other.vertexId; diff --git a/src/core/auth/qgsauthconfig.h b/src/core/auth/qgsauthconfig.h index 4b26fc4b208..b0a85975316 100644 --- a/src/core/auth/qgsauthconfig.h +++ b/src/core/auth/qgsauthconfig.h @@ -49,6 +49,8 @@ class CORE_EXPORT QgsAuthMethodConfig */ QgsAuthMethodConfig( const QString &method = QString(), int version = 0 ); + // TODO c++20 - replace with = default + //! Operator used to compare configs' equality bool operator==( const QgsAuthMethodConfig &other ) const; diff --git a/src/core/editform/qgseditformconfig.h b/src/core/editform/qgseditformconfig.h index 54e7d915354..48eb985a3a0 100644 --- a/src/core/editform/qgseditformconfig.h +++ b/src/core/editform/qgseditformconfig.h @@ -124,7 +124,7 @@ class CORE_EXPORT QgsEditFormConfig ~QgsEditFormConfig(); QgsEditFormConfig &operator=( const QgsEditFormConfig &o ); - + // TODO c++20 - replace with = default bool operator==( const QgsEditFormConfig &o ); /** diff --git a/src/core/geometry/qgsgeometry.h b/src/core/geometry/qgsgeometry.h index 13a5bba25ea..bdd122e5993 100644 --- a/src/core/geometry/qgsgeometry.h +++ b/src/core/geometry/qgsgeometry.h @@ -2312,6 +2312,7 @@ class CORE_EXPORT QgsGeometry % End #endif + // TODO c++20 - replace with = default bool operator==( const QgsGeometry::Error &other ) const { return other.mMessage == mMessage && other.mHasLocation == mHasLocation && other.mLocation == mLocation; diff --git a/src/core/geometry/qgslinesegment.h b/src/core/geometry/qgslinesegment.h index 4fc35776103..8012318e0ad 100644 --- a/src/core/geometry/qgslinesegment.h +++ b/src/core/geometry/qgslinesegment.h @@ -218,6 +218,8 @@ class CORE_EXPORT QgsLineSegment2D std::swap( mStart, mEnd ); } + // TODO c++20 - replace with = default + //! Equality operator bool operator==( const QgsLineSegment2D &other ) const SIP_HOLDGIL { diff --git a/src/core/metadata/qgsabstractmetadatabase.h b/src/core/metadata/qgsabstractmetadatabase.h index e73b2f6f796..c48be4f53be 100644 --- a/src/core/metadata/qgsabstractmetadatabase.h +++ b/src/core/metadata/qgsabstractmetadatabase.h @@ -127,6 +127,7 @@ class CORE_EXPORT QgsAbstractMetadataBase */ QString country; + // TODO c++20 - replace with = default bool operator==( const QgsAbstractMetadataBase::Address &other ) const; }; @@ -188,6 +189,7 @@ class CORE_EXPORT QgsAbstractMetadataBase */ QString role; + // TODO c++20 - replace with = default bool operator==( const QgsAbstractMetadataBase::Contact &other ) const; }; @@ -252,6 +254,7 @@ class CORE_EXPORT QgsAbstractMetadataBase */ QString size; + // TODO c++20 - replace with = default bool operator==( const QgsAbstractMetadataBase::Link &other ) const; }; diff --git a/src/core/metadata/qgslayermetadata.h b/src/core/metadata/qgslayermetadata.h index 85842d971aa..9e218180c19 100644 --- a/src/core/metadata/qgslayermetadata.h +++ b/src/core/metadata/qgslayermetadata.h @@ -81,6 +81,7 @@ class CORE_EXPORT QgsLayerMetadata : public QgsAbstractMetadataBase */ QgsBox3d bounds; + // TODO c++20 - replace with = default bool operator==( const QgsLayerMetadata::SpatialExtent &other ) const; }; @@ -118,6 +119,7 @@ class CORE_EXPORT QgsLayerMetadata : public QgsAbstractMetadataBase */ void setTemporalExtents( const QList< QgsDateTimeRange > &extents ); + // TODO c++20 - replace with = default bool operator==( const QgsLayerMetadata::Extent &other ) const; #ifndef SIP_RUN @@ -155,6 +157,7 @@ class CORE_EXPORT QgsLayerMetadata : public QgsAbstractMetadataBase */ QString constraint; + // TODO c++20 - replace with = default bool operator==( const QgsLayerMetadata::Constraint &other ) const; }; diff --git a/src/core/pointcloud/qgspointcloudindex.h b/src/core/pointcloud/qgspointcloudindex.h index 466b9e76b23..fd22607c22d 100644 --- a/src/core/pointcloud/qgspointcloudindex.h +++ b/src/core/pointcloud/qgspointcloudindex.h @@ -62,6 +62,8 @@ class CORE_EXPORT IndexedPointCloudNode //! Returns whether node is valid bool isValid() const { return mD >= 0; } + // TODO c++20 - replace with = default + //! Compares nodes bool operator==( IndexedPointCloudNode other ) const { diff --git a/src/core/processing/models/qgsprocessingmodelchilddependency.h b/src/core/processing/models/qgsprocessingmodelchilddependency.h index 761b4cfbe74..6d0fdb1440b 100644 --- a/src/core/processing/models/qgsprocessingmodelchilddependency.h +++ b/src/core/processing/models/qgsprocessingmodelchilddependency.h @@ -72,6 +72,7 @@ class CORE_EXPORT QgsProcessingModelChildDependency return true; } + // TODO c++20 - replace with = default bool operator==( const QgsProcessingModelChildDependency &other ) const { return childId == other.childId && conditionalBranch == other.conditionalBranch; diff --git a/src/core/processing/qgsprocessingparameters.h b/src/core/processing/qgsprocessingparameters.h index ee641f26fb5..db8f3dca035 100644 --- a/src/core/processing/qgsprocessingparameters.h +++ b/src/core/processing/qgsprocessingparameters.h @@ -162,6 +162,7 @@ class CORE_EXPORT QgsProcessingFeatureSourceDefinition */ bool loadVariant( const QVariantMap &map ); + // TODO c++20 - replace with = default bool operator==( const QgsProcessingFeatureSourceDefinition &other ) const { return source == other.source @@ -296,6 +297,7 @@ class CORE_EXPORT QgsProcessingOutputLayerDefinition return QVariant::fromValue( *this ); } + // TODO c++20 - replace with = default bool operator==( const QgsProcessingOutputLayerDefinition &other ) const; bool operator!=( const QgsProcessingOutputLayerDefinition &other ) const; diff --git a/src/core/proj/qgscoordinatetransformcontext_p.h b/src/core/proj/qgscoordinatetransformcontext_p.h index bd065933a68..97507bac01d 100644 --- a/src/core/proj/qgscoordinatetransformcontext_p.h +++ b/src/core/proj/qgscoordinatetransformcontext_p.h @@ -64,6 +64,7 @@ class QgsCoordinateTransformContextPrivate : public QSharedData QString operation; bool allowFallback = true; + // TODO c++20 - replace with = default bool operator==( const OperationDetails &other ) const { return operation == other.operation && allowFallback == other.allowFallback; diff --git a/src/core/proj/qgsdatumtransform.h b/src/core/proj/qgsdatumtransform.h index ec81e473683..66dc4e5d085 100644 --- a/src/core/proj/qgsdatumtransform.h +++ b/src/core/proj/qgsdatumtransform.h @@ -73,6 +73,7 @@ class CORE_EXPORT QgsDatumTransform */ int destinationTransformId = -1; + // TODO c++20 - replace with = default bool operator==( QgsDatumTransform::TransformPair other ) const { return other.sourceTransformId == sourceTransformId && other.destinationTransformId == destinationTransformId; diff --git a/src/core/providers/qgsabstractdatabaseproviderconnection.h b/src/core/providers/qgsabstractdatabaseproviderconnection.h index 8008a2661ca..e2886fa7d58 100644 --- a/src/core/providers/qgsabstractdatabaseproviderconnection.h +++ b/src/core/providers/qgsabstractdatabaseproviderconnection.h @@ -234,6 +234,7 @@ class CORE_EXPORT QgsAbstractDatabaseProviderConnection : public QgsAbstractProv QgsWkbTypes::Type wkbType; QgsCoordinateReferenceSystem crs; + // TODO c++20 - replace with = default inline bool operator==( const GeometryColumnType &other ) const { return this->crs == other.crs && this->wkbType == other.wkbType; diff --git a/src/core/providers/qgsprovidersublayerdetails.h b/src/core/providers/qgsprovidersublayerdetails.h index be664e88d3f..bfae95c2981 100644 --- a/src/core/providers/qgsprovidersublayerdetails.h +++ b/src/core/providers/qgsprovidersublayerdetails.h @@ -230,6 +230,7 @@ class CORE_EXPORT QgsProviderSublayerDetails */ void setLayerNumber( int number ) { mLayerNumber = number; } + // TODO c++20 - replace with = default bool operator==( const QgsProviderSublayerDetails &other ) const; bool operator!=( const QgsProviderSublayerDetails &other ) const; diff --git a/src/core/qgsattributetableconfig.h b/src/core/qgsattributetableconfig.h index c73eacb4deb..edd2c10cdce 100644 --- a/src/core/qgsattributetableconfig.h +++ b/src/core/qgsattributetableconfig.h @@ -54,6 +54,7 @@ class CORE_EXPORT QgsAttributeTableConfig //! Constructor for ColumnConfig ColumnConfig() = default; + // TODO c++20 - replace with = default bool operator== ( const QgsAttributeTableConfig::ColumnConfig &other ) const SIP_SKIP; QgsAttributeTableConfig::Type type = Field; //!< The type of this column. diff --git a/src/core/qgsbookmarkmanager.h b/src/core/qgsbookmarkmanager.h index 8eaa585a281..12257ceed9e 100644 --- a/src/core/qgsbookmarkmanager.h +++ b/src/core/qgsbookmarkmanager.h @@ -116,6 +116,7 @@ class CORE_EXPORT QgsBookmark % End #endif + // TODO c++20 - replace with = default bool operator==( const QgsBookmark &other ); bool operator!=( const QgsBookmark &other ); diff --git a/src/core/qgsdefaultvalue.h b/src/core/qgsdefaultvalue.h index 273717f9229..3541ac9852f 100644 --- a/src/core/qgsdefaultvalue.h +++ b/src/core/qgsdefaultvalue.h @@ -59,6 +59,8 @@ class CORE_EXPORT QgsDefaultValue * \see QgsVectorLayer::setDefaultValueDefinition */ explicit QgsDefaultValue( const QString &expression = QString(), bool applyOnUpdate = false ); + + // TODO c++20 - replace with = default bool operator==( const QgsDefaultValue &other ) const; /** diff --git a/src/core/qgsfield_p.h b/src/core/qgsfield_p.h index 1f99af0c298..7ba6c0a28bb 100644 --- a/src/core/qgsfield_p.h +++ b/src/core/qgsfield_p.h @@ -84,6 +84,7 @@ class QgsFieldPrivate : public QSharedData ~QgsFieldPrivate() = default; + // TODO c++20 - replace with = default bool operator==( const QgsFieldPrivate &other ) const { return ( ( name == other.name ) && ( type == other.type ) && ( subType == other.subType ) diff --git a/src/core/qgsfieldconstraints.h b/src/core/qgsfieldconstraints.h index 2bd1b86a4b3..efa0efee393 100644 --- a/src/core/qgsfieldconstraints.h +++ b/src/core/qgsfieldconstraints.h @@ -141,6 +141,7 @@ class CORE_EXPORT QgsFieldConstraints */ void setConstraintExpression( const QString &expression, const QString &description = QString() ); + // TODO c++20 - replace with = default bool operator==( const QgsFieldConstraints &other ) const; private: diff --git a/src/core/qgsfields.h b/src/core/qgsfields.h index 9c7142eb9a9..34e4faa5f38 100644 --- a/src/core/qgsfields.h +++ b/src/core/qgsfields.h @@ -67,6 +67,8 @@ class CORE_EXPORT QgsFields , originIndex( oi ) {} + // TODO c++20 - replace with = default + //! \since QGIS 2.6 bool operator==( const Field &other ) const { return field == other.field && origin == other.origin && originIndex == other.originIndex; } //! \since QGIS 2.6 diff --git a/src/core/qgsmaplayerdependency.h b/src/core/qgsmaplayerdependency.h index 8fc12a8f74d..6da3a7d9721 100644 --- a/src/core/qgsmaplayerdependency.h +++ b/src/core/qgsmaplayerdependency.h @@ -67,6 +67,8 @@ class CORE_EXPORT QgsMapLayerDependency //! Returns the ID of the layer this dependency depends on QString layerId() const { return mLayerId; } + // TODO c++20 - replace with = default + //! Comparison operator bool operator==( const QgsMapLayerDependency &other ) const { diff --git a/src/core/qgsmapthemecollection.h b/src/core/qgsmapthemecollection.h index 71a5621abb6..a4bbfbe3500 100644 --- a/src/core/qgsmapthemecollection.h +++ b/src/core/qgsmapthemecollection.h @@ -61,6 +61,7 @@ class CORE_EXPORT QgsMapThemeCollection : public QObject //! Initialize layer record with a map layer - it will be stored as a weak pointer MapThemeLayerRecord( QgsMapLayer *l = nullptr ): mLayer( l ) {} + // TODO c++20 - replace with = default bool operator==( const QgsMapThemeCollection::MapThemeLayerRecord &other ) const { return mLayer == other.mLayer && isVisible == other.isVisible && diff --git a/src/core/qgspointlocator.h b/src/core/qgspointlocator.h index bf9d4a2857c..f3962e4c9f7 100644 --- a/src/core/qgspointlocator.h +++ b/src/core/qgspointlocator.h @@ -276,6 +276,7 @@ class CORE_EXPORT QgsPointLocator : public QObject return point; } + // TODO c++20 - replace with = default bool operator==( const QgsPointLocator::Match &other ) const { return mType == other.mType && diff --git a/src/core/qgsreadwritecontext.h b/src/core/qgsreadwritecontext.h index b6b5c5da939..fa01fefff30 100644 --- a/src/core/qgsreadwritecontext.h +++ b/src/core/qgsreadwritecontext.h @@ -57,6 +57,8 @@ class CORE_EXPORT QgsReadWriteContext //! Returns the stack of categories of the message QStringList categories() const {return mCategories;} + // TODO c++20 - replace with = default + bool operator==( const QgsReadWriteContext::ReadWriteMessage &other ) const { return mMessage == other.mMessage && mLevel == other.mLevel && mCategories == other.mCategories; diff --git a/src/core/qgsremappingproxyfeaturesink.h b/src/core/qgsremappingproxyfeaturesink.h index 29cf9de0e71..ebc3985f0d3 100644 --- a/src/core/qgsremappingproxyfeaturesink.h +++ b/src/core/qgsremappingproxyfeaturesink.h @@ -143,6 +143,7 @@ class CORE_EXPORT QgsRemappingSinkDefinition */ bool loadVariant( const QVariantMap &map ); + // TODO c++20 - replace with = default bool operator==( const QgsRemappingSinkDefinition &other ) const; bool operator!=( const QgsRemappingSinkDefinition &other ) const; diff --git a/src/core/qgssnappingconfig.h b/src/core/qgssnappingconfig.h index e7c5fe02ed4..0f2c16b8e30 100644 --- a/src/core/qgssnappingconfig.h +++ b/src/core/qgssnappingconfig.h @@ -219,6 +219,7 @@ class CORE_EXPORT QgsSnappingConfig */ bool operator!= ( const QgsSnappingConfig::IndividualLayerSettings &other ) const; + // TODO c++20 - replace with = default bool operator== ( const QgsSnappingConfig::IndividualLayerSettings &other ) const; private: diff --git a/src/core/qgssnappingutils.h b/src/core/qgssnappingutils.h index 000d1e1402c..00e5f4f632b 100644 --- a/src/core/qgssnappingutils.h +++ b/src/core/qgssnappingutils.h @@ -146,6 +146,7 @@ class CORE_EXPORT QgsSnappingUtils : public QObject , unit( u ) {} + // TODO c++20 - replace with = default bool operator==( const QgsSnappingUtils::LayerConfig &other ) const { return layer == other.layer && type == other.type && tolerance == other.tolerance && unit == other.unit; diff --git a/src/core/qgstemporalutils.h b/src/core/qgstemporalutils.h index 89e921de6b6..97924faa94f 100644 --- a/src/core/qgstemporalutils.h +++ b/src/core/qgstemporalutils.h @@ -65,9 +65,10 @@ class CORE_EXPORT QgsTimeDuration !hours && !minutes && !seconds; } + // TODO c++20 - replace with = default bool operator==( const QgsTimeDuration &other ) const { - return years == other.years && months == other.months && + return years == other.years && months == other.months && weeks == other.weeks && days == other.days && hours == other.hours && minutes == other.minutes && seconds == other.seconds; } diff --git a/src/core/qgsvector3d.h b/src/core/qgsvector3d.h index a7eecf5bbf6..0a1d9d27663 100644 --- a/src/core/qgsvector3d.h +++ b/src/core/qgsvector3d.h @@ -60,6 +60,7 @@ class CORE_EXPORT QgsVector3D mZ = z; } + // TODO c++20 - replace with = default bool operator==( const QgsVector3D &other ) const { return mX == other.mX && mY == other.mY && mZ == other.mZ; diff --git a/src/core/symbology/qgssymbollayerreference.h b/src/core/symbology/qgssymbollayerreference.h index 3179f3160f4..863f53c04e6 100644 --- a/src/core/symbology/qgssymbollayerreference.h +++ b/src/core/symbology/qgssymbollayerreference.h @@ -85,6 +85,8 @@ class CORE_EXPORT QgsSymbolLayerId */ QVector symbolLayerIndexPath() const { return mIndexPath; } + // TODO c++20 - replace with = default + //! Equality operator bool operator==( const QgsSymbolLayerId &other ) const {