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.cpp | |
| 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.cpp')
| -rw-r--r-- | src/corelib/tools/qeasingcurve.cpp | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/src/corelib/tools/qeasingcurve.cpp b/src/corelib/tools/qeasingcurve.cpp index d8b3367de3d..52602a0256e 100644 --- a/src/corelib/tools/qeasingcurve.cpp +++ b/src/corelib/tools/qeasingcurve.cpp @@ -1153,32 +1153,37 @@ QEasingCurve::~QEasingCurve() */ /*! - Compare this easing curve with \a other and returns \c true if they are - equal. It will also compare the properties of a curve. + \fn bool QEasingCurve::operator==(const QEasingCurve &lhs, const QEasingCurve &rhs) + + Compares easing curve \a lhs with \a rhs and returns \c true if they are + equal; otherwise returns \c false. + It will also compare the properties of the curves. */ -bool QEasingCurve::operator==(const QEasingCurve &other) const +bool comparesEqual(const QEasingCurve &lhs, const QEasingCurve &rhs) noexcept { - bool res = d_ptr->func == other.d_ptr->func - && d_ptr->type == other.d_ptr->type; + bool res = lhs.d_ptr->func == rhs.d_ptr->func + && lhs.d_ptr->type == rhs.d_ptr->type; if (res) { - if (d_ptr->config && other.d_ptr->config) { + if (lhs.d_ptr->config && rhs.d_ptr->config) { // catch the config content - res = d_ptr->config->operator==(*(other.d_ptr->config)); + res = lhs.d_ptr->config->operator==(*(rhs.d_ptr->config)); - } else if (d_ptr->config || other.d_ptr->config) { + } else if (lhs.d_ptr->config || rhs.d_ptr->config) { // one one has a config object, which could contain default values - res = qFuzzyCompare(amplitude(), other.amplitude()) - && qFuzzyCompare(period(), other.period()) - && qFuzzyCompare(overshoot(), other.overshoot()); + res = qFuzzyCompare(lhs.amplitude(), rhs.amplitude()) + && qFuzzyCompare(lhs.period(), rhs.period()) + && qFuzzyCompare(lhs.overshoot(), rhs.overshoot()); } } return res; } /*! - \fn bool QEasingCurve::operator!=(const QEasingCurve &other) const - Compare this easing curve with \a other and returns \c true if they are not equal. - It will also compare the properties of a curve. + \fn bool QEasingCurve::operator!=(const QEasingCurve &lhs, const QEasingCurve &rhs) + + Compares easing curve \a lhs with \a rhs and returns \c true if they are + not equal; otherwise returns \c false. + It will also compare the properties of the curves. \sa operator==() */ |
