diff options
Diffstat (limited to 'tests/auto/qpropertyanimation')
-rw-r--r-- | tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp b/tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp index bea399c..b92e140 100644 --- a/tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp +++ b/tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp @@ -75,6 +75,20 @@ private: qreal m_x; }; +class DummyPropertyAnimation : public QPropertyAnimation +{ +public: + DummyPropertyAnimation(QObject *parent = 0) : QPropertyAnimation(parent) + { + setTargetObject(&o); + this->setPropertyName("x"); + setEndValue(100); + } + + MyObject o; +}; + + class tst_QPropertyAnimation : public QObject { Q_OBJECT @@ -224,7 +238,11 @@ void tst_QPropertyAnimation::statesAndSignals_data() void tst_QPropertyAnimation::statesAndSignals() { QFETCH(bool, uncontrolled); - QPropertyAnimation *anim = uncontrolled ? new UncontrolledAnimation : new QPropertyAnimation; + QPropertyAnimation *anim; + if (uncontrolled) + anim = new UncontrolledAnimation; + else + anim = new DummyPropertyAnimation; anim->setDuration(100); QSignalSpy finishedSpy(anim, SIGNAL(finished())); @@ -833,7 +851,7 @@ void tst_QPropertyAnimation::setStartEndValues() void tst_QPropertyAnimation::zeroDurationStart() { - QPropertyAnimation anim; + DummyPropertyAnimation anim; QSignalSpy spy(&anim, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State))); anim.setDuration(0); QCOMPARE(anim.state(), QAbstractAnimation::Stopped); |