diff options
author | Ivan Solovev <ivan.solovev@qt.io> | 2024-04-26 13:07:28 +0200 |
---|---|---|
committer | Ivan Solovev <ivan.solovev@qt.io> | 2024-05-10 16:31:28 +0200 |
commit | a4341827ac17c14541ea69c67c76aaae5a09ddcc (patch) | |
tree | 4d3c3446e2b22f95525d71900bb6cad374b918e6 /src/corelib/tools/qeasingcurve.h | |
parent | 473d06970d224b202e7a8ee8feaa2a2d98d5b257 (diff) |
QEasingCurve: use comparison helper macros
Like with the QLine(F) case, we have to use QT_CORE_REMOVED_SINCE to
remove the old member operators, but also need to guard the new friend
functions with !(QT_CORE_REMOVED_SINCE), because QEasingCurve is also
one of the core types, and on Windows the metatype interface for it is
instantiated in removed_api.cpp.
Task-number: QTBUG-120308
Change-Id: I1bd66f7230afd3eba868d05fd496ab13a0331178
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
Diffstat (limited to 'src/corelib/tools/qeasingcurve.h')
-rw-r--r-- | src/corelib/tools/qeasingcurve.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/corelib/tools/qeasingcurve.h b/src/corelib/tools/qeasingcurve.h index 5b112d7d7d..61e9aa247d 100644 --- a/src/corelib/tools/qeasingcurve.h +++ b/src/corelib/tools/qeasingcurve.h @@ -8,6 +8,7 @@ QT_REQUIRE_CONFIG(easingcurve); +#include <QtCore/qcompare.h> #include <QtCore/qlist.h> #include <QtCore/qobjectdefs.h> @@ -47,9 +48,11 @@ public: void swap(QEasingCurve &other) noexcept { qt_ptr_swap(d_ptr, other.d_ptr); } +#if QT_CORE_REMOVED_SINCE(6, 8) bool operator==(const QEasingCurve &other) const; inline bool operator!=(const QEasingCurve &other) const { return !(this->operator==(other)); } +#endif qreal amplitude() const; void setAmplitude(qreal amplitude); @@ -81,6 +84,11 @@ private: friend Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QEasingCurve &); friend Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QEasingCurve &); #endif + friend Q_CORE_EXPORT bool + comparesEqual(const QEasingCurve &lhs, const QEasingCurve &rhs) noexcept; +#if !QT_CORE_REMOVED_SINCE(6, 8) + Q_DECLARE_EQUALITY_COMPARABLE(QEasingCurve) +#endif }; Q_DECLARE_SHARED(QEasingCurve) |