aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/animations
diff options
context:
space:
mode:
authorMarco Bubke <marco.bubke@digia.com>2012-11-22 11:28:57 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-11-22 12:34:41 +0100
commit8fc95e65e77328c995ef4a3a633a95c86f5e0bdf (patch)
treec36f38de6625c04b1ab51e08f8f9e7e78dc1fa1f /src/qml/animations
parentc2a6e7276dfce6142202ee9db4aaaf15a53cb530 (diff)
Add designer support for animations and componentComplete
In the designer animations confuse users, if you change a state or move a item around. Also component complete is called later by the designer. The call in the VME is to early. Change-Id: I49aa04edbc49fb44ddb7b52062307982865efd7e Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
Diffstat (limited to 'src/qml/animations')
-rw-r--r--src/qml/animations/qabstractanimationjob.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/qml/animations/qabstractanimationjob.cpp b/src/qml/animations/qabstractanimationjob.cpp
index 20b8b4bf57..df8431e746 100644
--- a/src/qml/animations/qabstractanimationjob.cpp
+++ b/src/qml/animations/qabstractanimationjob.cpp
@@ -44,6 +44,7 @@
#include "private/qabstractanimationjob_p.h"
#include "private/qanimationgroupjob_p.h"
#include "private/qanimationjobutil_p.h"
+#include "private/qqmlengine_p.h"
#define DEFAULT_TIMER_INTERVAL 16
@@ -473,7 +474,17 @@ void QAbstractAnimationJob::start()
{
if (m_state == Running)
return;
- setState(Running);
+
+ if (QQmlEnginePrivate::designerMode()) {
+ if (state() != Stopped) {
+ m_currentTime = duration();
+ m_totalCurrentTime = totalDuration();
+ setState(Running);
+ setState(Stopped);
+ }
+ } else {
+ setState(Running);
+ }
}
void QAbstractAnimationJob::stop()