diff options
Diffstat (limited to 'src/declarative/util')
-rw-r--r-- | src/declarative/util/qmlanimation.cpp | 84 | ||||
-rw-r--r-- | src/declarative/util/qmlanimation_p.h | 29 | ||||
-rw-r--r-- | src/declarative/util/qmlbehaviour.cpp | 9 | ||||
-rw-r--r-- | src/declarative/util/qmlbehaviour.h | 2 | ||||
-rw-r--r-- | src/declarative/util/qmlconnection.cpp | 9 | ||||
-rw-r--r-- | src/declarative/util/qmlfollow.cpp | 1 | ||||
-rw-r--r-- | src/declarative/util/qmllistmodel.cpp | 11 | ||||
-rw-r--r-- | src/declarative/util/qmlscript.cpp | 20 | ||||
-rw-r--r-- | src/declarative/util/qmlstate.cpp | 1 | ||||
-rw-r--r-- | src/declarative/util/qmlstate.h | 1 | ||||
-rw-r--r-- | src/declarative/util/qmlstateoperations.cpp | 8 | ||||
-rw-r--r-- | src/declarative/util/qmltransition.h | 1 |
12 files changed, 100 insertions, 76 deletions
diff --git a/src/declarative/util/qmlanimation.cpp b/src/declarative/util/qmlanimation.cpp index ede4008..91a5361 100644 --- a/src/declarative/util/qmlanimation.cpp +++ b/src/declarative/util/qmlanimation.cpp @@ -40,19 +40,19 @@ ****************************************************************************/ #include "qmlanimation.h" -#include "gfxtimeline.h" #include "qvariant.h" #include "qcolor.h" #include "qfile.h" -#include "gfxeasing.h" #include "qmlpropertyvaluesource.h" #include "qml.h" #include "qmlanimation_p.h" -#include "gfxtimeline.h" #include "qmlbehaviour.h" #include <QParallelAnimationGroup> #include <QSequentialAnimationGroup> #include <QtCore/qset.h> +#include <QtCore/qrect.h> +#include <QtCore/qpoint.h> +#include <QtCore/qsize.h> #include <QtDeclarative/qmlexpression.h> #include <private/qmlstringconverters_p.h> #include <private/qvariantanimation_p.h> @@ -653,7 +653,7 @@ QmlColorAnimation::~QmlColorAnimation() void QmlColorAnimationPrivate::init() { Q_Q(QmlColorAnimation); - ca = new GfxValueAnimator(q); + ca = new QmlTimeLineValueAnimator(q); ca->setStartValue(QVariant(0.0f)); ca->setEndValue(QVariant(1.0f)); } @@ -791,7 +791,7 @@ void QmlColorAnimation::prepare(QmlMetaProperty &p) else d->property = d->userProperty; d->fromSourced = false; - d->value.GfxValue::setValue(0.); + d->value.QmlTimeLineValue::setValue(0.); d->ca->setAnimValue(&d->value, QAbstractAnimation::KeepWhenStopped); } @@ -808,7 +808,7 @@ void QmlColorAnimation::transition(QmlStateActions &actions, Q_D(QmlColorAnimation); Q_UNUSED(direction); - struct NTransitionData : public GfxValue + struct NTransitionData : public QmlTimeLineValue { QmlStateActions actions; void write(QmlMetaProperty &property, const QColor &color) @@ -820,7 +820,7 @@ void QmlColorAnimation::transition(QmlStateActions &actions, void setValue(qreal v) { - GfxValue::setValue(v); + QmlTimeLineValue::setValue(v); for(int ii = 0; ii < actions.count(); ++ii) { Action &action = actions[ii]; @@ -1004,7 +1004,7 @@ void QmlRunScriptActionPrivate::execute() } if(!scriptStr.isEmpty()) { - QmlExpression expr(ctxt, scriptStr, q); + QmlExpression expr(qmlContext(q), scriptStr, q); expr.setTrackChange(false); expr.value(); } @@ -1362,7 +1362,7 @@ QmlNumericAnimation::~QmlNumericAnimation() void QmlNumericAnimationPrivate::init() { Q_Q(QmlNumericAnimation); - na = new GfxValueAnimator(q); + na = new QmlTimeLineValueAnimator(q); na->setStartValue(QVariant(0.0f)); na->setEndValue(QVariant(1.0f)); } @@ -1447,7 +1447,57 @@ void QmlNumericAnimation::setTo(qreal t) emit toChanged(t); } -/* XML docs in GfxEasing */ +/*! + \qmlproperty string NumericAnimation::easing + \brief the easing curve used for the transition. + + Available values are: + + \list + \i \e easeNone - Easing equation function for a simple linear tweening, with no easing. + \i \e easeInQuad - Easing equation function for a quadratic (t^2) easing in: accelerating from zero velocity. + \i \e easeOutQuad - Easing equation function for a quadratic (t^2) easing out: decelerating to zero velocity. + \i \e easeInOutQuad - Easing equation function for a quadratic (t^2) easing in/out: acceleration until halfway, then deceleration. + \i \e easeOutInQuad - Easing equation function for a quadratic (t^2) easing out/in: deceleration until halfway, then acceleration. + \i \e easeInCubic - Easing equation function for a cubic (t^3) easing in: accelerating from zero velocity. + \i \e easeOutCubic - Easing equation function for a cubic (t^3) easing out: decelerating from zero velocity. + \i \e easeInOutCubic - Easing equation function for a cubic (t^3) easing in/out: acceleration until halfway, then deceleration. + \i \e easeOutInCubic - Easing equation function for a cubic (t^3) easing out/in: deceleration until halfway, then acceleration. + \i \e easeInQuart - Easing equation function for a quartic (t^4) easing in: accelerating from zero velocity. + \i \e easeOutQuart - Easing equation function for a quartic (t^4) easing out: decelerating from zero velocity. + \i \e easeInOutQuart - Easing equation function for a quartic (t^4) easing in/out: acceleration until halfway, then deceleration. + \i \e easeOutInQuart - Easing equation function for a quartic (t^4) easing out/in: deceleration until halfway, then acceleration. + \i \e easeInQuint - Easing equation function for a quintic (t^5) easing in: accelerating from zero velocity. + \i \e easeOutQuint - Easing equation function for a quintic (t^5) easing out: decelerating from zero velocity. + \i \e easeInOutQuint - Easing equation function for a quintic (t^5) easing in/out: acceleration until halfway, then deceleration. + \i \e easeOutInQuint - Easing equation function for a quintic (t^5) easing out/in: deceleration until halfway, then acceleration. + \i \e easeInSine - Easing equation function for a sinusoidal (sin(t)) easing in: accelerating from zero velocity. + \i \e easeOutSine - Easing equation function for a sinusoidal (sin(t)) easing out: decelerating from zero velocity. + \i \e easeInOutSine - Easing equation function for a sinusoidal (sin(t)) easing in/out: acceleration until halfway, then deceleration. + \i \e easeOutInSine - Easing equation function for a sinusoidal (sin(t)) easing out/in: deceleration until halfway, then acceleration. + \i \e easeInExpo - Easing equation function for an exponential (2^t) easing in: accelerating from zero velocity. + \i \e easeOutExpo - Easing equation function for an exponential (2^t) easing out: decelerating from zero velocity. + \i \e easeInOutExpo - Easing equation function for an exponential (2^t) easing in/out: acceleration until halfway, then deceleration. + \i \e easeOutInExpo - Easing equation function for an exponential (2^t) easing out/in: deceleration until halfway, then acceleration. + \i \e easeInCirc - Easing equation function for a circular (sqrt(1-t^2)) easing in: accelerating from zero velocity. + \i \e easeOutCirc - Easing equation function for a circular (sqrt(1-t^2)) easing out: decelerating from zero velocity. + \i \e easeInOutCirc - Easing equation function for a circular (sqrt(1-t^2)) easing in/out: acceleration until halfway, then deceleration. + \i \e easeOutInCirc - Easing equation function for a circular (sqrt(1-t^2)) easing out/in: deceleration until halfway, then acceleration. + \i \e easeInElastic - Easing equation function for an elastic (exponentially decaying sine wave) easing in: accelerating from zero velocity. The peak amplitude can be set with the \e amplitude parameter, and the period of decay by the \e period parameter. + \i \e easeOutElastic - Easing equation function for an elastic (exponentially decaying sine wave) easing out: decelerating from zero velocity. The peak amplitude can be set with the \e amplitude parameter, and the period of decay by the \e period parameter. + \i \e easeInOutElastic - Easing equation function for an elastic (exponentially decaying sine wave) easing in/out: acceleration until halfway, then deceleration. + \i \e easeOutInElastic - Easing equation function for an elastic (exponentially decaying sine wave) easing out/in: deceleration until halfway, then acceleration. + \i \e easeInBack - Easing equation function for a back (overshooting cubic easing: (s+1)*t^3 - s*t^2) easing in: accelerating from zero velocity. + \i \e easeOutBack - Easing equation function for a back (overshooting cubic easing: (s+1)*t^3 - s*t^2) easing out: decelerating from zero velocity. + \i \e easeInOutBack - Easing equation function for a back (overshooting cubic easing: (s+1)*t^3 - s*t^2) easing in/out: acceleration until halfway, then deceleration. + \i \e easeOutInBack - Easing equation function for a back (overshooting cubic easing: (s+1)*t^3 - s*t^2) easing out/in: deceleration until halfway, then acceleration. + \i \e easeOutBounce - Easing equation function for a bounce (exponentially decaying parabolic bounce) easing out: decelerating from zero velocity. + \i \e easeInBounce - Easing equation function for a bounce (exponentially decaying parabolic bounce) easing in: accelerating from zero velocity. + \i \e easeInOutBounce - Easing equation function for a bounce (exponentially decaying parabolic bounce) easing in/out: acceleration until halfway, then deceleration. + \i \e easeOutInBounce - Easing equation function for a bounce (exponentially decaying parabolic bounce) easing out/in: deceleration until halfway, then acceleration. + \endlist +*/ + /*! \property QmlNumericAnimation::easing This property holds the easing curve to use. @@ -1550,7 +1600,7 @@ void QmlNumericAnimation::prepare(QmlMetaProperty &p) else d->property = d->userProperty; d->fromSourced = false; - d->value.GfxValue::setValue(0.); + d->value.QmlTimeLineValue::setValue(0.); d->na->setAnimValue(&d->value, QAbstractAnimation::KeepWhenStopped); } @@ -1567,12 +1617,12 @@ void QmlNumericAnimation::transition(QmlStateActions &actions, Q_D(QmlNumericAnimation); Q_UNUSED(direction); - struct NTransitionData : public GfxValue + struct NTransitionData : public QmlTimeLineValue { QmlStateActions actions; void setValue(qreal v) { - GfxValue::setValue(v); + QmlTimeLineValue::setValue(v); for(int ii = 0; ii < actions.count(); ++ii) { Action &action = actions[ii]; @@ -1901,7 +1951,7 @@ QmlVariantAnimation::~QmlVariantAnimation() void QmlVariantAnimationPrivate::init() { Q_Q(QmlVariantAnimation); - va = new GfxValueAnimator(q); + va = new QmlTimeLineValueAnimator(q); va->setStartValue(QVariant(0.0f)); va->setEndValue(QVariant(1.0f)); } @@ -2107,7 +2157,7 @@ void QmlVariantAnimation::prepare(QmlMetaProperty &p) d->convertVariant(d->from.value, (QVariant::Type)d->property.propertyType()); d->fromSourced = false; - d->value.GfxValue::setValue(0.); + d->value.QmlTimeLineValue::setValue(0.); d->va->setAnimValue(&d->value, QAbstractAnimation::KeepWhenStopped); } @@ -2118,12 +2168,12 @@ void QmlVariantAnimation::transition(QmlStateActions &actions, Q_D(QmlVariantAnimation); Q_UNUSED(direction); - struct NTransitionData : public GfxValue + struct NTransitionData : public QmlTimeLineValue { QmlStateActions actions; void setValue(qreal v) { - GfxValue::setValue(v); + QmlTimeLineValue::setValue(v); for(int ii = 0; ii < actions.count(); ++ii) { Action &action = actions[ii]; diff --git a/src/declarative/util/qmlanimation_p.h b/src/declarative/util/qmlanimation_p.h index db7cb18..80cc7f7 100644 --- a/src/declarative/util/qmlanimation_p.h +++ b/src/declarative/util/qmlanimation_p.h @@ -52,7 +52,7 @@ #include <QVariantAnimation> #include <QAnimationGroup> #include <QColor> -#include <gfxvalueproxy.h> +#include <qmltimelinevalueproxy.h> QT_BEGIN_NAMESPACE @@ -112,13 +112,13 @@ private: DeletionPolicy policy; }; -//animates GfxValue (assumes start and end values will be reals or compatible) -class GfxValueAnimator : public QVariantAnimation +//animates QmlTimeLineValue (assumes start and end values will be reals or compatible) +class QmlTimeLineValueAnimator : public QVariantAnimation { public: - GfxValueAnimator(QObject *parent = 0) : QVariantAnimation(parent), animValue(0), policy(KeepWhenStopped) {} - GfxValueAnimator(GfxValue *value, QObject *parent = 0) : QVariantAnimation(parent), animValue(value), policy(KeepWhenStopped) {} - void setAnimValue(GfxValue *value, DeletionPolicy p) + QmlTimeLineValueAnimator(QObject *parent = 0) : QVariantAnimation(parent), animValue(0), policy(KeepWhenStopped) {} + QmlTimeLineValueAnimator(QmlTimeLineValue *value, QObject *parent = 0) : QVariantAnimation(parent), animValue(value), policy(KeepWhenStopped) {} + void setAnimValue(QmlTimeLineValue *value, DeletionPolicy p) { if (state() == Running) stop(); @@ -141,7 +141,7 @@ protected: } private: - GfxValue *animValue; + QmlTimeLineValue *animValue; DeletionPolicy policy; }; @@ -214,10 +214,10 @@ public: bool fromSourced; QColor fromValue; QColor toValue; - GfxValueAnimator *ca; + QmlTimeLineValueAnimator *ca; virtual void valueChanged(qreal); - GfxValueProxy<QmlColorAnimationPrivate> value; + QmlTimeLineValueProxy<QmlColorAnimationPrivate> value; }; class QmlRunScriptActionPrivate : public QmlAbstractAnimationPrivate @@ -225,13 +225,12 @@ class QmlRunScriptActionPrivate : public QmlAbstractAnimationPrivate Q_DECLARE_PUBLIC(QmlRunScriptAction); public: QmlRunScriptActionPrivate() - : QmlAbstractAnimationPrivate(), ctxt(QmlContext::activeContext()), proxy(this), rsa(0) {} + : QmlAbstractAnimationPrivate(), proxy(this), rsa(0) {} void init(); QString script; QString file; - QmlContext* ctxt; void execute(); @@ -295,10 +294,10 @@ public: bool fromSourced; qreal fromValue; - GfxValueAnimator *na; + QmlTimeLineValueAnimator *na; virtual void valueChanged(qreal); - GfxValueProxy<QmlNumericAnimationPrivate> value; + QmlTimeLineValueProxy<QmlNumericAnimationPrivate> value; }; class QmlAnimationGroupPrivate : public QmlAbstractAnimationPrivate @@ -360,10 +359,10 @@ public: bool fromSourced; QVariant fromValue; - GfxValueAnimator *va; + QmlTimeLineValueAnimator *va; virtual void valueChanged(qreal); - GfxValueProxy<QmlVariantAnimationPrivate> value; + QmlTimeLineValueProxy<QmlVariantAnimationPrivate> value; static QVariant interpolateVariant(const QVariant &from, const QVariant &to, qreal progress); static void convertVariant(QVariant &variant, QVariant::Type type); diff --git a/src/declarative/util/qmlbehaviour.cpp b/src/declarative/util/qmlbehaviour.cpp index 3169f63..3fff06c 100644 --- a/src/declarative/util/qmlbehaviour.cpp +++ b/src/declarative/util/qmlbehaviour.cpp @@ -76,14 +76,13 @@ class QmlBehaviourPrivate : public QObjectPrivate { public: QmlBehaviourPrivate() - : context(0), oldContext(0), valueData(0), operations(this) {} + : context(0), valueData(0), operations(this) {} QmlMetaProperty property; QVariant currentValue; QVariant fromValue; QVariant toValue; QmlContext *context; - QmlContext *oldContext; QmlBehaviourData *valueData; class AnimationList : public QmlConcreteList<QmlAbstractAnimation *> { @@ -123,8 +122,6 @@ QmlBehaviour::QmlBehaviour(QObject *parent) { Q_D(QmlBehaviour); d->valueData = new QmlBehaviourData(this); - d->context = new QmlContext(QmlContext::activeContext(), this); - d->context->addDefaultObject(d->valueData); d->group = new QSequentialAnimationGroup(this); } @@ -234,6 +231,10 @@ void QmlBehaviour::setTarget(const QmlMetaProperty &property) void QmlBehaviour::classBegin() { Q_D(QmlBehaviour); + if(!d->context) { + d->context = new QmlContext(qmlContext(this), this); + d->context->addDefaultObject(d->valueData); + } d->context->activate(); } diff --git a/src/declarative/util/qmlbehaviour.h b/src/declarative/util/qmlbehaviour.h index 080423a..3d25cd8 100644 --- a/src/declarative/util/qmlbehaviour.h +++ b/src/declarative/util/qmlbehaviour.h @@ -45,8 +45,6 @@ #include <qmlpropertyvaluesource.h> #include <qml.h> #include <qmlstate.h> -#include <gfxtimeline.h> - QT_BEGIN_HEADER diff --git a/src/declarative/util/qmlconnection.cpp b/src/declarative/util/qmlconnection.cpp index df45a31..b2fd450 100644 --- a/src/declarative/util/qmlconnection.cpp +++ b/src/declarative/util/qmlconnection.cpp @@ -51,9 +51,8 @@ QT_BEGIN_NAMESPACE class QmlConnectionPrivate : public QObjectPrivate { public: - QmlConnectionPrivate() : ctxt(0), boundsignal(0), signalSender(0), componentcomplete(false) {} + QmlConnectionPrivate() : boundsignal(0), signalSender(0), componentcomplete(false) {} - QmlContext *ctxt; QmlBoundSignal *boundsignal; QObject *signalSender; QString script; @@ -112,8 +111,6 @@ public: QmlConnection::QmlConnection(QObject *parent) : QObject(*(new QmlConnectionPrivate), parent) { - Q_D(QmlConnection); - d->ctxt = QmlContext::activeContext(); } QmlConnection::~QmlConnection() @@ -192,9 +189,9 @@ void QmlConnection::connectIfValid() } if (sigparams.isEmpty()) - d->boundsignal = new QmlBoundSignal(d->ctxt, d->script, sender, sigIdx, this); + d->boundsignal = new QmlBoundSignal(qmlContext(this), d->script, sender, sigIdx, this); else - d->boundsignal = new QmlBoundSignalProxy(new QmlContext(d->ctxt,this), d->script, sender, sigIdx, this); + d->boundsignal = new QmlBoundSignalProxy(new QmlContext(qmlContext(this),this), d->script, sender, sigIdx, this); } } diff --git a/src/declarative/util/qmlfollow.cpp b/src/declarative/util/qmlfollow.cpp index 01d8962..35f3c49 100644 --- a/src/declarative/util/qmlfollow.cpp +++ b/src/declarative/util/qmlfollow.cpp @@ -41,7 +41,6 @@ #include <limits.h> #include <QtCore/qdebug.h> -#include <gfxtimeline.h> #include "private/qobject_p.h" #include "qmlfollow.h" #include "private/qmlanimation_p.h" diff --git a/src/declarative/util/qmllistmodel.cpp b/src/declarative/util/qmllistmodel.cpp index 992185a..24f2d5c 100644 --- a/src/declarative/util/qmllistmodel.cpp +++ b/src/declarative/util/qmllistmodel.cpp @@ -537,7 +537,6 @@ ModelNode::~ModelNode() struct ListModelData { int dataOffset; - int id; int instrCount; ListInstruction *instructions() const { return (ListInstruction *)((char *)this + sizeof(ListModelData)); } }; @@ -546,7 +545,6 @@ QByteArray ListModelParser::compile(QXmlStreamReader& reader, bool *ok) { *ok = true; - QByteArray id; QByteArray data; QList<ListInstruction> instr; int depth=0; @@ -649,10 +647,6 @@ QByteArray ListModelParser::compile(QXmlStreamReader& reader, bool *ok) rv.resize(size); ListModelData *lmd = (ListModelData *)rv.data(); - if(id.count()) - lmd->id = 0; - else - lmd->id = -1; lmd->dataOffset = sizeof(ListModelData) + instr.count() * sizeof(ListInstruction); lmd->instrCount = instr.count(); @@ -709,11 +703,6 @@ QVariant ListModelParser::create(const QByteArray &d) } } - if(lmd->id != -1) { - QmlContext *ctxt = QmlContext::activeContext(); - ctxt->setContextProperty(QLatin1String(data + lmd->id), rv); - } - return QVariant::fromValue(rv); } diff --git a/src/declarative/util/qmlscript.cpp b/src/declarative/util/qmlscript.cpp index 859e21e..73c8c07 100644 --- a/src/declarative/util/qmlscript.cpp +++ b/src/declarative/util/qmlscript.cpp @@ -65,7 +65,7 @@ class QmlScriptPrivate : public QObjectPrivate Q_DECLARE_PUBLIC(QmlScript); public: - QmlScriptPrivate() : reply(0), ctxt(0) {} + QmlScriptPrivate() : reply(0) {} void addScriptToEngine(const QString &, const QString &fileName=QString()); @@ -73,7 +73,6 @@ public: QString source; QNetworkReply *reply; QUrl url; - QmlContext *ctxt; }; /*! @@ -106,8 +105,6 @@ public: QML_DEFINE_TYPE(QmlScript,Script); QmlScript::QmlScript(QObject *parent) : QObject(*(new QmlScriptPrivate), parent) { - Q_D(QmlScript); - d->ctxt = QmlContext::activeContext(); } /*! @@ -154,10 +151,10 @@ void QmlScript::setSource(const QString &source) if (d->source == source) return; d->source = source; - d->url = d->ctxt->resolvedUrl(source); + d->url = qmlContext(this)->resolvedUrl(source); QNetworkRequest req(d->url); req.setAttribute(QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::PreferCache); - d->reply = d->ctxt->engine()->networkAccessManager()->get(req); + d->reply = qmlEngine(this)->networkAccessManager()->get(req); QObject::connect(d->reply, SIGNAL(finished()), this, SLOT(replyFinished())); } @@ -176,7 +173,8 @@ void QmlScript::replyFinished() void QmlScriptPrivate::addScriptToEngine(const QString &script, const QString &fileName) { Q_Q(QmlScript); - QmlEngine *engine = ctxt->engine(); + QmlEngine *engine = qmlEngine(q); + QmlContext *context = qmlContext(q); QScriptEngine *scriptEngine = engine->scriptEngine(); QScriptContext *currentContext = engine->scriptEngine()->currentContext(); @@ -186,11 +184,11 @@ void QmlScriptPrivate::addScriptToEngine(const QString &script, const QString &f for (int i = 0; i < oldScopeChain.size(); ++i) { currentContext->popScope(); } - for (int i = ctxt->d_func()->scopeChain.size() - 1; i > -1; --i) { - currentContext->pushScope(ctxt->d_func()->scopeChain.at(i)); + for (int i = context->d_func()->scopeChain.size() - 1; i > -1; --i) { + currentContext->pushScope(context->d_func()->scopeChain.at(i)); } - currentContext->setActivationObject(ctxt->d_func()->scopeChain.at(0)); + currentContext->setActivationObject(context->d_func()->scopeChain.at(0)); QScriptValue val = scriptEngine->evaluate(script, fileName); if (scriptEngine->hasUncaughtException()) { @@ -209,7 +207,7 @@ void QmlScriptPrivate::addScriptToEngine(const QString &script, const QString &f currentContext->setActivationObject(oldact); - for (int i = 0; i < ctxt->d_func()->scopeChain.size(); ++i) + for (int i = 0; i < context->d_func()->scopeChain.size(); ++i) currentContext->popScope(); for (int i = oldScopeChain.size() - 1; i > -1; --i) diff --git a/src/declarative/util/qmlstate.cpp b/src/declarative/util/qmlstate.cpp index f07fecb..9b1b695 100644 --- a/src/declarative/util/qmlstate.cpp +++ b/src/declarative/util/qmlstate.cpp @@ -39,7 +39,6 @@ ** ****************************************************************************/ -#include <gfxeasing.h> #include "qmltransition.h" #include "qmlstategroup.h" #include "qmlstate_p.h" diff --git a/src/declarative/util/qmlstate.h b/src/declarative/util/qmlstate.h index 3e6727d..68c43fa 100644 --- a/src/declarative/util/qmlstate.h +++ b/src/declarative/util/qmlstate.h @@ -44,7 +44,6 @@ #include <QtCore/qobject.h> #include <qfxglobal.h> -#include <gfxtimeline.h> #include <qml.h> #include <QSequentialAnimationGroup> diff --git a/src/declarative/util/qmlstateoperations.cpp b/src/declarative/util/qmlstateoperations.cpp index a8779f9..c70977a 100644 --- a/src/declarative/util/qmlstateoperations.cpp +++ b/src/declarative/util/qmlstateoperations.cpp @@ -40,7 +40,6 @@ ****************************************************************************/ #include <private/qobject_p.h> -#include <gfxeasing.h> #include <qml.h> #include <QtDeclarative/qmlcontext.h> #include "qmlbindablevalue.h" @@ -137,9 +136,8 @@ QmlStateOperation::ActionList QmlParentChange::actions() class QmlRunScriptPrivate : public QObjectPrivate { public: - QmlRunScriptPrivate() : ctxt(0) {} + QmlRunScriptPrivate() {} - QmlContext *ctxt; QString script; QString name; }; @@ -152,8 +150,6 @@ QML_DEFINE_TYPE(QmlRunScript,RunScript); QmlRunScript::QmlRunScript(QObject *parent) : QmlStateOperation(*(new QmlRunScriptPrivate), parent) { - Q_D(QmlRunScript); - d->ctxt = QmlContext::activeContext(); } QmlRunScript::~QmlRunScript() @@ -192,7 +188,7 @@ void QmlRunScript::execute() { Q_D(QmlRunScript); if(!d->script.isEmpty()) { - QmlExpression expr(d->ctxt, d->script, this); + QmlExpression expr(qmlContext(this), d->script, this); expr.setTrackChange(false); expr.value(); } diff --git a/src/declarative/util/qmltransition.h b/src/declarative/util/qmltransition.h index 0d86b7d..0b7ea14 100644 --- a/src/declarative/util/qmltransition.h +++ b/src/declarative/util/qmltransition.h @@ -44,7 +44,6 @@ #include <QtCore/qobject.h> #include <qfxglobal.h> -#include <gfxtimeline.h> #include <qmlstate.h> #include <qml.h> |