diff --git a/src/declarative/qml/qdeclarativeenginedebug.cpp b/src/declarative/qml/qdeclarativeenginedebug.cpp index ed28185..eabc298 100644 --- a/src/declarative/qml/qdeclarativeenginedebug.cpp +++ b/src/declarative/qml/qdeclarativeenginedebug.cpp @@ -52,6 +52,9 @@ #include "private/qdeclarativevaluetype_p.h" #include "private/qdeclarativevmemetaobject_p.h" #include "private/qdeclarativeexpression_p.h" +#include "qabstractanimation.h" +#include "private/qabstractanimation_p.h" + #include #include @@ -484,6 +487,10 @@ void QDeclarativeEngineDebugServer::messageReceived(const QByteArray &message) QString methodBody; ds >> objectId >> methodName >> methodBody; setMethodBody(objectId, methodName, methodBody); + } else if (type == "SET_ANIM_SLOWDOWN_FACTOR") { + qreal slowdownFactor; + ds >> slowdownFactor; + setSlowdownFactor(slowdownFactor); } } @@ -578,6 +585,19 @@ void QDeclarativeEngineDebugServer::setMethodBody(int objectId, const QString &m vmeMetaObject->setVmeMethod(prop->coreIndex, QDeclarativeExpressionPrivate::evalInObjectScope(contextData, object, jsfunction, contextData->url.toString(), lineNumber, 0)); } +void QDeclarativeEngineDebugServer::setSlowdownFactor(qreal slowdownFactor) +{ + QUnifiedTimer *timer = QUnifiedTimer::instance(); + if (slowdownFactor == 0) { + timer->setSlowdownFactor(0); + timer->setSlowModeEnabled(true); + } else { + bool slowModeEnabled = (slowdownFactor != 1.0f); + timer->setSlowdownFactor(slowdownFactor); + timer->setSlowModeEnabled(slowModeEnabled); + } +} + void QDeclarativeEngineDebugServer::propertyChanged(int id, int objectId, const QMetaProperty &property, const QVariant &value) { QByteArray reply; diff --git a/src/declarative/qml/qdeclarativeenginedebug_p.h b/src/declarative/qml/qdeclarativeenginedebug_p.h index 613f1fe..4137b89 100644 --- a/src/declarative/qml/qdeclarativeenginedebug_p.h +++ b/src/declarative/qml/qdeclarativeenginedebug_p.h @@ -113,6 +113,7 @@ private: void setBinding(int objectId, const QString &propertyName, const QVariant &expression, bool isLiteralValue); void resetBinding(int objectId, const QString &propertyName); void setMethodBody(int objectId, const QString &method, const QString &body); + void setSlowdownFactor(qreal animationSpeed); QList m_engines; QDeclarativeWatcher *m_watch;