diff --git a/src/corelib/tools/qeasingcurve.h b/src/corelib/tools/qeasingcurve.h index 33d7c6934e..64e4027fc4 100644 --- a/src/corelib/tools/qeasingcurve.h +++ b/src/corelib/tools/qeasingcurve.h @@ -84,6 +84,7 @@ public: QEasingCurve &operator=(const QEasingCurve &other); #ifdef Q_COMPILER_RVALUE_REFS + QEasingCurve(QEasingCurve &&other) : d_ptr(other.d_ptr) { other.d_ptr = 0; } QEasingCurve &operator=(QEasingCurve &&other) { qSwap(d_ptr, other.d_ptr); return *this; } #endif diff --git a/tests/auto/corelib/tools/qeasingcurve/tst_qeasingcurve.cpp b/tests/auto/corelib/tools/qeasingcurve/tst_qeasingcurve.cpp index 1d4e91dc00..40e3cd08b6 100644 --- a/tests/auto/corelib/tools/qeasingcurve/tst_qeasingcurve.cpp +++ b/tests/auto/corelib/tools/qeasingcurve/tst_qeasingcurve.cpp @@ -778,6 +778,12 @@ void tst_QEasingCurve::testCbrtFloat() void tst_QEasingCurve::cpp11() { #ifdef Q_COMPILER_RVALUE_REFS + { + QEasingCurve ec( QEasingCurve::InOutBack ); + QEasingCurve copy = std::move(ec); // move ctor + QCOMPARE( copy.type(), QEasingCurve::InOutBack ); + QVERIFY( *reinterpret_cast(&ec) == 0 ); + } { QEasingCurve ec( QEasingCurve::InOutBack ); QEasingCurve copy;