diff --git a/src/corelib/tools/qeasingcurve.cpp b/src/corelib/tools/qeasingcurve.cpp index 1734b03..1fb2c13 100644 --- a/src/corelib/tools/qeasingcurve.cpp +++ b/src/corelib/tools/qeasingcurve.cpp @@ -647,9 +647,12 @@ bool QEasingCurve::operator==(const QEasingCurve &other) const { bool res = d_ptr->func == other.d_ptr->func && d_ptr->type == other.d_ptr->type; - if (res && d_ptr->config && other.d_ptr->config) { + if (res) { // catch the config content - res = d_ptr->config->operator==(*(other.d_ptr->config)); + if (d_ptr->config && other.d_ptr->config) + res = d_ptr->config->operator==(*(other.d_ptr->config)); + else if (d_ptr->config != other.d_ptr->config) + res = false; } return res; } diff --git a/tests/auto/qeasingcurve/tst_qeasingcurve.cpp b/tests/auto/qeasingcurve/tst_qeasingcurve.cpp index 124f900..de59c78 100644 --- a/tests/auto/qeasingcurve/tst_qeasingcurve.cpp +++ b/tests/auto/qeasingcurve/tst_qeasingcurve.cpp @@ -505,6 +505,11 @@ void tst_QEasingCurve::operators() curve2.setType(QEasingCurve::InBack); QCOMPARE(curve.overshoot(), curve2.overshoot()); QVERIFY(curve2 == curve); + + QEasingCurve curve3; + QEasingCurve curve4; + curve4.setAmplitude(.3); + QVERIFY(curve3 != curve4); } class tst_QEasingProperties : public QObject