Q_Q(QQuickTransition);
if (newState == QAbstractAnimationJob::Running) {
- if (!runningInstanceCount)
- emit q->runningChanged();
runningInstanceCount++;
+ if (runningInstanceCount == 1)
+ emit q->runningChanged();
} else if (newState == QAbstractAnimationJob::Stopped) {
runningInstanceCount--;
- if (!runningInstanceCount)
+ if (runningInstanceCount == 0)
emit q->runningChanged();
}
}
QSignalSpy runningSpy(trans, SIGNAL(runningChanged()));
QQuickItemPrivate::get(rect)->setState("");
QCOMPARE(myRect->x(),qreal(200));
+ QCOMPARE(runningSpy.count(), 1); //stopped -> running
+ QVERIFY(trans->running());
QTest::qWait(300);
QTIMED_COMPARE(myRect->x(),qreal(100));
- QCOMPARE(runningSpy.count(), 2); //stopped, running, stopped
+ QVERIFY(!trans->running());
+ QCOMPARE(runningSpy.count(), 2); //running -> stopped
}
void tst_qquickanimations::invalidDuration()