Remane private QQuickAction into QQuickStateAction
authorGabriel de Dietrich <gabriel.dedietrich@digia.com>
Thu, 3 Oct 2013 15:04:40 +0000 (17:04 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Thu, 3 Oct 2013 15:48:34 +0000 (17:48 +0200)
This avoid symbol conflicts when statically linking with Qt Quick
Controls, that has its own QQuickAction class and which may become
public some day. (QQuickPropertyAction might be a more apt name, but
it's already taken).

Change-Id: Ia9514d63d38295603a89d8ec5a88815a651380f7
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
16 files changed:
src/quick/items/qquickflickable.cpp
src/quick/items/qquickitemanimation.cpp
src/quick/items/qquickitemviewtransition.cpp
src/quick/items/qquickstateoperations.cpp
src/quick/items/qquickstateoperations_p.h
src/quick/util/qquickanimation.cpp
src/quick/util/qquickanimator.cpp
src/quick/util/qquickbehavior.cpp
src/quick/util/qquickpropertychanges.cpp
src/quick/util/qquickstate.cpp
src/quick/util/qquickstate_p.h
src/quick/util/qquickstate_p_p.h
src/quick/util/qquickstatechangescript.cpp
src/quick/util/qquickstatechangescript_p.h
src/quick/util/qquicktransitionmanager.cpp
src/quick/util/qquicktransitionmanager_p_p.h

index d1caa82..9b5532c 100644 (file)
@@ -211,7 +211,7 @@ public:
         axisData->transitionToSet = true;
 
         actions.clear();
-        actions << QQuickAction(fp->contentItem, propName, toPos);
+        actions << QQuickStateAction(fp->contentItem, propName, toPos);
         QQuickTransitionManager::transition(actions, fp->rebound, fp->contentItem);
         return true;
     }
index ae12334..534ad0e 100644 (file)
@@ -221,7 +221,7 @@ QAbstractAnimationJob* QQuickParentAnimation::transition(QQuickStateActions &act
         virtual void doAction()
         {
             for (int ii = 0; ii < actions.count(); ++ii) {
-                const QQuickAction &action = actions.at(ii);
+                const QQuickStateAction &action = actions.at(ii);
                 if (reverse)
                     action.event->reverse();
                 else
@@ -236,7 +236,7 @@ QAbstractAnimationJob* QQuickParentAnimation::transition(QQuickStateActions &act
     bool hasExplicit = false;
     if (d->target && d->newParent) {
         data->reverse = false;
-        QQuickAction myAction;
+        QQuickStateAction myAction;
         QQuickParentChange *pc = new QQuickParentChange;
         pc->setObject(d->target);
         pc->setParent(d->newParent);
@@ -246,7 +246,7 @@ QAbstractAnimationJob* QQuickParentAnimation::transition(QQuickStateActions &act
         hasExplicit = true;
         if (d->via) {
             viaData->reverse = false;
-            QQuickAction myVAction;
+            QQuickStateAction myVAction;
             QQuickParentChange *vpc = new QQuickParentChange;
             vpc->setObject(d->target);
             vpc->setParent(d->via);
@@ -260,12 +260,12 @@ QAbstractAnimationJob* QQuickParentAnimation::transition(QQuickStateActions &act
 
     if (!hasExplicit)
     for (int i = 0; i < actions.size(); ++i) {
-        QQuickAction &action = actions[i];
-        if (action.event && action.event->type() == QQuickActionEvent::ParentChange
+        QQuickStateAction &action = actions[i];
+        if (action.event && action.event->type() == QQuickStateActionEvent::ParentChange
             && (!d->target || static_cast<QQuickParentChange*>(action.event)->object() == d->target)) {
 
             QQuickParentChange *pc = static_cast<QQuickParentChange*>(action.event);
-            QQuickAction myAction = action;
+            QQuickStateAction myAction = action;
             data->reverse = action.reverseEvent;
 
             //### this logic differs from PropertyAnimation
@@ -285,18 +285,18 @@ QAbstractAnimationJob* QQuickParentAnimation::transition(QQuickStateActions &act
 
             if (d->via) {
                 viaData->reverse = false;
-                QQuickAction myAction;
+                QQuickStateAction myAction;
                 QQuickParentChange *vpc = new QQuickParentChange;
                 vpc->setObject(pc->object());
                 vpc->setParent(d->via);
                 myAction.event = vpc;
                 viaData->pc << vpc;
                 viaData->actions << myAction;
-                QQuickAction dummyAction;
-                QQuickAction &xAction = pc->xIsSet() && i < actions.size()-1 ? actions[++i] : dummyAction;
-                QQuickAction &yAction = pc->yIsSet() && i < actions.size()-1 ? actions[++i] : dummyAction;
-                QQuickAction &sAction = pc->scaleIsSet() && i < actions.size()-1 ? actions[++i] : dummyAction;
-                QQuickAction &rAction = pc->rotationIsSet() && i < actions.size()-1 ? actions[++i] : dummyAction;
+                QQuickStateAction dummyAction;
+                QQuickStateAction &xAction = pc->xIsSet() && i < actions.size()-1 ? actions[++i] : dummyAction;
+                QQuickStateAction &yAction = pc->yIsSet() && i < actions.size()-1 ? actions[++i] : dummyAction;
+                QQuickStateAction &sAction = pc->scaleIsSet() && i < actions.size()-1 ? actions[++i] : dummyAction;
+                QQuickStateAction &rAction = pc->rotationIsSet() && i < actions.size()-1 ? actions[++i] : dummyAction;
                 QQuickItem *target = pc->object();
                 QQuickItem *targetParent = action.reverseEvent ? pc->originalParent() : pc->parent();
 
@@ -535,8 +535,8 @@ QAbstractAnimationJob* QQuickAnchorAnimation::transition(QQuickStateActions &act
     data->fromDefined = false;
 
     for (int ii = 0; ii < actions.count(); ++ii) {
-        QQuickAction &action = actions[ii];
-        if (action.event && action.event->type() == QQuickActionEvent::AnchorChanges
+        QQuickStateAction &action = actions[ii];
+        if (action.event && action.event->type() == QQuickStateActionEvent::AnchorChanges
             && (d->targets.isEmpty() || d->targets.contains(static_cast<QQuickAnchorChanges*>(action.event)->object()))) {
             data->actions << static_cast<QQuickAnchorChanges*>(action.event)->additionalActions();
         }
@@ -868,7 +868,7 @@ QAbstractAnimationJob* QQuickPathAnimation::transition(QQuickStateActions &actio
     int origModifiedSize = modified.count();
 
     for (int i = 0; i < actions.count(); ++i) {
-        QQuickAction &action = actions[i];
+        QQuickStateAction &action = actions[i];
         if (action.event)
             continue;
         if (action.specifiedObject == target && action.property.name() == QLatin1String("x")) {
index 22c0f94..0940fe0 100644 (file)
@@ -127,8 +127,8 @@ void QQuickItemViewTransitionJob::startTransition(QQuickItemViewTransitionableIt
     }
 
     QQuickStateOperation::ActionList actions;
-    actions << QQuickAction(item->item, QLatin1String("x"), QVariant(to.x()));
-    actions << QQuickAction(item->item, QLatin1String("y"), QVariant(to.y()));
+    actions << QQuickStateAction(item->item, QLatin1String("x"), QVariant(to.x()));
+    actions << QQuickStateAction(item->item, QLatin1String("y"), QVariant(to.y()));
 
     m_transitioner->runningJobs << this;
     QQuickTransitionManager::transition(actions, trans, item->item);
index 705d2e4..00c2103 100644 (file)
@@ -350,7 +350,7 @@ QQuickStateOperation::ActionList QQuickParentChange::actions()
 
     ActionList actions;
 
-    QQuickAction a;
+    QQuickStateAction a;
     a.event = this;
     actions << a;
 
@@ -358,13 +358,13 @@ QQuickStateOperation::ActionList QQuickParentChange::actions()
         bool ok = false;
         qreal x = d->xString.value.numberLiteral(&ok);
         if (ok) {
-            QQuickAction xa(d->target, QLatin1String("x"), x);
+            QQuickStateAction xa(d->target, QLatin1String("x"), x);
             actions << xa;
         } else {
             QQmlBinding *newBinding = new QQmlBinding(d->xString.value, d->target, qmlContext(this));
             QQmlProperty property(d->target, QLatin1String("x"));
             newBinding->setTarget(property);
-            QQuickAction xa;
+            QQuickStateAction xa;
             xa.property = property;
             xa.toBinding = QQmlAbstractBinding::getPointer(newBinding);
             xa.fromValue = xa.property.read();
@@ -377,13 +377,13 @@ QQuickStateOperation::ActionList QQuickParentChange::actions()
         bool ok = false;
         qreal y = d->yString.value.numberLiteral(&ok);
         if (ok) {
-            QQuickAction ya(d->target, QLatin1String("y"), y);
+            QQuickStateAction ya(d->target, QLatin1String("y"), y);
             actions << ya;
         } else {
             QQmlBinding *newBinding = new QQmlBinding(d->yString.value, d->target, qmlContext(this));
             QQmlProperty property(d->target, QLatin1String("y"));
             newBinding->setTarget(property);
-            QQuickAction ya;
+            QQuickStateAction ya;
             ya.property = property;
             ya.toBinding = QQmlAbstractBinding::getPointer(newBinding);
             ya.fromValue = ya.property.read();
@@ -396,13 +396,13 @@ QQuickStateOperation::ActionList QQuickParentChange::actions()
         bool ok = false;
         qreal scale = d->scaleString.value.numberLiteral(&ok);
         if (ok) {
-            QQuickAction sa(d->target, QLatin1String("scale"), scale);
+            QQuickStateAction sa(d->target, QLatin1String("scale"), scale);
             actions << sa;
         } else {
             QQmlBinding *newBinding = new QQmlBinding(d->scaleString.value, d->target, qmlContext(this));
             QQmlProperty property(d->target, QLatin1String("scale"));
             newBinding->setTarget(property);
-            QQuickAction sa;
+            QQuickStateAction sa;
             sa.property = property;
             sa.toBinding = QQmlAbstractBinding::getPointer(newBinding);
             sa.fromValue = sa.property.read();
@@ -415,13 +415,13 @@ QQuickStateOperation::ActionList QQuickParentChange::actions()
         bool ok = false;
         qreal rotation = d->rotationString.value.numberLiteral(&ok);
         if (ok) {
-            QQuickAction ra(d->target, QLatin1String("rotation"), rotation);
+            QQuickStateAction ra(d->target, QLatin1String("rotation"), rotation);
             actions << ra;
         } else {
             QQmlBinding *newBinding = new QQmlBinding(d->rotationString.value, d->target, qmlContext(this));
             QQmlProperty property(d->target, QLatin1String("rotation"));
             newBinding->setTarget(property);
-            QQuickAction ra;
+            QQuickStateAction ra;
             ra.property = property;
             ra.toBinding = QQmlAbstractBinding::getPointer(newBinding);
             ra.fromValue = ra.property.read();
@@ -434,13 +434,13 @@ QQuickStateOperation::ActionList QQuickParentChange::actions()
         bool ok = false;
         qreal width = d->widthString.value.numberLiteral(&ok);
         if (ok) {
-            QQuickAction wa(d->target, QLatin1String("width"), width);
+            QQuickStateAction wa(d->target, QLatin1String("width"), width);
             actions << wa;
         } else {
             QQmlBinding *newBinding = new QQmlBinding(d->widthString.value, d->target, qmlContext(this));
             QQmlProperty property(d->target, QLatin1String("width"));
             newBinding->setTarget(property);
-            QQuickAction wa;
+            QQuickStateAction wa;
             wa.property = property;
             wa.toBinding = QQmlAbstractBinding::getPointer(newBinding);
             wa.fromValue = wa.property.read();
@@ -453,13 +453,13 @@ QQuickStateOperation::ActionList QQuickParentChange::actions()
         bool ok = false;
         qreal height = d->heightString.value.numberLiteral(&ok);
         if (ok) {
-            QQuickAction ha(d->target, QLatin1String("height"), height);
+            QQuickStateAction ha(d->target, QLatin1String("height"), height);
             actions << ha;
         } else {
             QQmlBinding *newBinding = new QQmlBinding(d->heightString.value, d->target, qmlContext(this));
             QQmlProperty property(d->target, QLatin1String("height"));
             newBinding->setTarget(property);
-            QQuickAction ha;
+            QQuickStateAction ha;
             ha.property = property;
             ha.toBinding = QQmlAbstractBinding::getPointer(newBinding);
             ha.fromValue = ha.property.read();
@@ -479,7 +479,7 @@ void QQuickParentChange::saveOriginals()
     d->origStackBefore = d->rewindStackBefore;
 }
 
-/*void QQuickParentChange::copyOriginals(QQuickActionEvent *other)
+/*void QQuickParentChange::copyOriginals(QQuickStateActionEvent *other)
 {
     Q_D(QQuickParentChange);
     QQuickParentChange *pc = static_cast<QQuickParentChange*>(other);
@@ -507,12 +507,12 @@ void QQuickParentChange::reverse(Reason)
     d->doChange(d->origParent, d->origStackBefore);
 }
 
-QQuickActionEvent::EventType QQuickParentChange::type() const
+QQuickStateActionEvent::EventType QQuickParentChange::type() const
 {
     return ParentChange;
 }
 
-bool QQuickParentChange::override(QQuickActionEvent*other)
+bool QQuickParentChange::override(QQuickStateActionEvent*other)
 {
     Q_D(QQuickParentChange);
     if (other->type() != ParentChange)
@@ -926,7 +926,7 @@ QQuickAnchorChanges::ActionList QQuickAnchorChanges::actions()
         d->baselineBinding->setTarget(d->baselineProp);
     }
 
-    QQuickAction a;
+    QQuickStateAction a;
     a.event = this;
     return ActionList() << a;
 }
@@ -1191,22 +1191,22 @@ void QQuickAnchorChanges::reverse(Reason reason)
         d->target->setY(d->origY);
 }
 
-QQuickActionEvent::EventType QQuickAnchorChanges::type() const
+QQuickStateActionEvent::EventType QQuickAnchorChanges::type() const
 {
     return AnchorChanges;
 }
 
-QList<QQuickAction> QQuickAnchorChanges::additionalActions()
+QList<QQuickStateAction> QQuickAnchorChanges::additionalActions()
 {
     Q_D(QQuickAnchorChanges);
-    QList<QQuickAction> extra;
+    QList<QQuickStateAction> extra;
 
     QQuickAnchors::Anchors combined = d->anchorSet->d_func()->usedAnchors | d->anchorSet->d_func()->resetAnchors;
     bool hChange = combined & QQuickAnchors::Horizontal_Mask;
     bool vChange = combined & QQuickAnchors::Vertical_Mask;
 
     if (d->target) {
-        QQuickAction a;
+        QQuickStateAction a;
         if (hChange && d->fromX != d->toX) {
             a.property = QQmlProperty(d->target, QLatin1String("x"));
             a.toValue = d->toX;
@@ -1265,7 +1265,7 @@ void QQuickAnchorChanges::saveOriginals()
     saveCurrentValues();
 }
 
-void QQuickAnchorChanges::copyOriginals(QQuickActionEvent *other)
+void QQuickAnchorChanges::copyOriginals(QQuickStateActionEvent *other)
 {
     Q_D(QQuickAnchorChanges);
     QQuickAnchorChanges *ac = static_cast<QQuickAnchorChanges*>(other);
@@ -1301,7 +1301,7 @@ void QQuickAnchorChanges::copyOriginals(QQuickActionEvent *other)
                 << acp->topBinding << acp->bottomBinding << acp->vCenterBinding << acp->baselineBinding;
 
     //clear old values from other
-    //### could this be generalized for all QQuickActionEvents, and called after copyOriginals?
+    //### could this be generalized for all QQuickStateActionEvents, and called after copyOriginals?
     acp->leftBinding = 0;
     acp->rightBinding = 0;
     acp->hCenterBinding = 0;
@@ -1368,11 +1368,11 @@ void QQuickAnchorChanges::clearBindings()
     }
 }
 
-bool QQuickAnchorChanges::override(QQuickActionEvent*other)
+bool QQuickAnchorChanges::override(QQuickStateActionEvent*other)
 {
     if (other->type() != AnchorChanges)
         return false;
-    if (static_cast<QQuickActionEvent*>(this) == other)
+    if (static_cast<QQuickStateActionEvent*>(this) == other)
         return true;
     if (static_cast<QQuickAnchorChanges*>(other)->object() == object())
         return true;
index d1d69f0..bb81be7 100644 (file)
@@ -52,7 +52,7 @@
 QT_BEGIN_NAMESPACE
 
 class QQuickParentChangePrivate;
-class Q_AUTOTEST_EXPORT QQuickParentChange : public QQuickStateOperation, public QQuickActionEvent
+class Q_AUTOTEST_EXPORT QQuickParentChange : public QQuickStateOperation, public QQuickStateActionEvent
 {
     Q_OBJECT
     Q_DECLARE_PRIVATE(QQuickParentChange)
@@ -104,12 +104,12 @@ public:
     virtual ActionList actions();
 
     virtual void saveOriginals();
-    //virtual void copyOriginals(QQuickActionEvent*);
+    //virtual void copyOriginals(QQuickStateActionEvent*);
     virtual void execute(Reason reason = ActualChange);
     virtual bool isReversable();
     virtual void reverse(Reason reason = ActualChange);
     virtual EventType type() const;
-    virtual bool override(QQuickActionEvent*other);
+    virtual bool override(QQuickStateActionEvent*other);
     virtual void rewind();
     virtual void saveCurrentValues();
 };
@@ -169,7 +169,7 @@ private:
 };
 
 class QQuickAnchorChangesPrivate;
-class Q_AUTOTEST_EXPORT QQuickAnchorChanges : public QQuickStateOperation, public QQuickActionEvent
+class Q_AUTOTEST_EXPORT QQuickAnchorChanges : public QQuickStateOperation, public QQuickStateActionEvent
 {
     Q_OBJECT
     Q_DECLARE_PRIVATE(QQuickAnchorChanges)
@@ -192,16 +192,16 @@ public:
     virtual bool isReversable();
     virtual void reverse(Reason reason = ActualChange);
     virtual EventType type() const;
-    virtual bool override(QQuickActionEvent*other);
+    virtual bool override(QQuickStateActionEvent*other);
     virtual bool changesBindings();
     virtual void saveOriginals();
     virtual bool needsCopy() { return true; }
-    virtual void copyOriginals(QQuickActionEvent*);
+    virtual void copyOriginals(QQuickStateActionEvent*);
     virtual void clearBindings();
     virtual void rewind();
     virtual void saveCurrentValues();
 
-    QList<QQuickAction> additionalActions();
+    QList<QQuickStateAction> additionalActions();
     virtual void saveTargetValues();
 };
 
index a357802..6a762be 100644 (file)
@@ -982,9 +982,9 @@ QAbstractAnimationJob* QQuickScriptAction::transition(QQuickStateActions &action
     d->reversing = (direction == Backward);
     if (!d->name.isEmpty()) {
         for (int ii = 0; ii < actions.count(); ++ii) {
-            QQuickAction &action = actions[ii];
+            QQuickStateAction &action = actions[ii];
 
-            if (action.event && action.event->type() == QQuickActionEvent::Script
+            if (action.event && action.event->type() == QQuickStateActionEvent::Script
                 && static_cast<QQuickStateChangeScript*>(action.event)->name() == d->name) {
                 d->runScriptScript = static_cast<QQuickStateChangeScript*>(action.event)->script();
                 d->hasRunScriptScript = true;
@@ -1162,7 +1162,7 @@ QAbstractAnimationJob* QQuickPropertyAction::transition(QQuickStateActions &acti
         virtual void doAction()
         {
             for (int ii = 0; ii < actions.count(); ++ii) {
-                const QQuickAction &action = actions.at(ii);
+                const QQuickStateAction &action = actions.at(ii);
                 QQmlPropertyPrivate::write(action.property, action.toValue, QQmlPropertyPrivate::BypassInterceptor | QQmlPropertyPrivate::DontRemoveBinding);
             }
         }
@@ -1195,7 +1195,7 @@ QAbstractAnimationJob* QQuickPropertyAction::transition(QQuickStateActions &acti
     if (d->value.isValid()) {
         for (int i = 0; i < props.count(); ++i) {
             for (int j = 0; j < targets.count(); ++j) {
-                QQuickAction myAction;
+                QQuickStateAction myAction;
                 myAction.property = d->createProperty(targets.at(j), props.at(i), this);
                 if (myAction.property.isValid()) {
                     myAction.toValue = d->value;
@@ -1203,7 +1203,7 @@ QAbstractAnimationJob* QQuickPropertyAction::transition(QQuickStateActions &acti
                     data->actions << myAction;
                     hasExplicit = true;
                     for (int ii = 0; ii < actions.count(); ++ii) {
-                        QQuickAction &action = actions[ii];
+                        QQuickStateAction &action = actions[ii];
                         if (action.property.object() == myAction.property.object() &&
                             myAction.property.name() == action.property.name()) {
                             modified << action.property;
@@ -1217,7 +1217,7 @@ QAbstractAnimationJob* QQuickPropertyAction::transition(QQuickStateActions &acti
 
     if (!hasExplicit)
     for (int ii = 0; ii < actions.count(); ++ii) {
-        QQuickAction &action = actions[ii];
+        QQuickStateAction &action = actions[ii];
 
         QObject *obj = action.property.object();
         QString propertyName = action.property.name();
@@ -1228,7 +1228,7 @@ QAbstractAnimationJob* QQuickPropertyAction::transition(QQuickStateActions &acti
         if ((targets.isEmpty() || targets.contains(obj) || (!same && targets.contains(sObj))) &&
            (!d->exclude.contains(obj)) && (same || (!d->exclude.contains(sObj))) &&
            (props.contains(propertyName) || (!same && props.contains(sPropertyName)))) {
-            QQuickAction myAction = action;
+            QQuickStateAction myAction = action;
 
             if (d->value.isValid())
                 myAction.toValue = d->value;
@@ -2468,7 +2468,7 @@ void QQuickAnimationPropertyUpdater::setValue(qreal v)
     if (reverse)
         v = 1 - v;
     for (int ii = 0; ii < actions.count(); ++ii) {
-        QQuickAction &action = actions[ii];
+        QQuickStateAction &action = actions[ii];
 
         if (v == 1.) {
             QQmlPropertyPrivate::write(action.property, action.toValue, QQmlPropertyPrivate::BypassInterceptor | QQmlPropertyPrivate::DontRemoveBinding);
@@ -2533,7 +2533,7 @@ QQuickStateActions QQuickPropertyAnimation::createTransitionActions(QQuickStateA
     if (d->toIsDefined) {
         for (int i = 0; i < props.count(); ++i) {
             for (int j = 0; j < targets.count(); ++j) {
-                QQuickAction myAction;
+                QQuickStateAction myAction;
                 myAction.property = d->createProperty(targets.at(j), props.at(i), this);
                 if (myAction.property.isValid()) {
                     if (d->fromIsDefined) {
@@ -2545,7 +2545,7 @@ QQuickStateActions QQuickPropertyAnimation::createTransitionActions(QQuickStateA
                     newActions << myAction;
                     hasExplicit = true;
                     for (int ii = 0; ii < actions.count(); ++ii) {
-                        QQuickAction &action = actions[ii];
+                        QQuickStateAction &action = actions[ii];
                         if (action.property.object() == myAction.property.object() &&
                             myAction.property.name() == action.property.name()) {
                             modified << action.property;
@@ -2559,7 +2559,7 @@ QQuickStateActions QQuickPropertyAnimation::createTransitionActions(QQuickStateA
 
     if (!hasExplicit)
     for (int ii = 0; ii < actions.count(); ++ii) {
-        QQuickAction &action = actions[ii];
+        QQuickStateAction &action = actions[ii];
 
         QObject *obj = action.property.object();
         QString propertyName = action.property.name();
@@ -2571,7 +2571,7 @@ QQuickStateActions QQuickPropertyAnimation::createTransitionActions(QQuickStateA
            (!d->exclude.contains(obj)) && (same || (!d->exclude.contains(sObj))) &&
            (props.contains(propertyName) || (!same && props.contains(sPropertyName))
                || (useType && action.property.propertyType() == d->interpolatorType))) {
-            QQuickAction myAction = action;
+            QQuickStateAction myAction = action;
 
             if (d->fromIsDefined)
                 myAction.fromValue = d->from;
index 592b6a0..a5bdd82 100644 (file)
@@ -220,7 +220,7 @@ void QQuickAnimatorPrivate::apply(QQuickAnimatorJob *job,
 
     if (actions.size()) {
         for (int i=0; i<actions.size(); ++i) {
-            QQuickAction &action = actions[i];
+            QQuickStateAction &action = actions[i];
             if (action.property.name() != propertyName)
                 continue;
             modified << action.property;
index 69ebb22..460e2ca 100644 (file)
@@ -202,7 +202,7 @@ void QQuickBehavior::write(const QVariant &value)
     const QVariant &currentValue = d->property.read();
 
     QQuickStateOperation::ActionList actions;
-    QQuickAction action;
+    QQuickStateAction action;
     action.property = d->property;
     action.fromValue = currentValue;
     action.toValue = value;
index cada612..148c55b 100644 (file)
@@ -135,7 +135,7 @@ QT_BEGIN_NAMESPACE
     This property holds the object which contains the properties to be changed.
 */
 
-class QQuickReplaceSignalHandler : public QQuickActionEvent
+class QQuickReplaceSignalHandler : public QQuickStateActionEvent
 {
 public:
     QQuickReplaceSignalHandler() {}
@@ -163,7 +163,7 @@ public:
     }
 
     virtual bool needsCopy() { return true; }
-    virtual void copyOriginals(QQuickActionEvent *other)
+    virtual void copyOriginals(QQuickStateActionEvent *other)
     {
         QQuickReplaceSignalHandler *rsh = static_cast<QQuickReplaceSignalHandler*>(other);
         saveCurrentValues();
@@ -179,7 +179,7 @@ public:
         rewindExpression = QQmlPropertyPrivate::signalExpression(property);
     }
 
-    virtual bool override(QQuickActionEvent*other) {
+    virtual bool override(QQuickStateActionEvent*other) {
         if (other == this)
             return true;
         if (other->type() != type())
@@ -445,7 +445,7 @@ QQuickPropertyChanges::ActionList QQuickPropertyChanges::actions()
 
     for (int ii = 0; ii < d->properties.count(); ++ii) {
 
-        QQuickAction a(d->object, d->properties.at(ii).first,
+        QQuickStateAction a(d->object, d->properties.at(ii).first,
                  qmlContext(this), d->properties.at(ii).second);
 
         if (a.property.isValid()) {
@@ -459,7 +459,7 @@ QQuickPropertyChanges::ActionList QQuickPropertyChanges::actions()
         QQuickReplaceSignalHandler *handler = d->signalReplacements.at(ii);
 
         if (handler->property.isValid()) {
-            QQuickAction a;
+            QQuickStateAction a;
             a.event = handler;
             list << a;
         }
@@ -472,7 +472,7 @@ QQuickPropertyChanges::ActionList QQuickPropertyChanges::actions()
         QQmlProperty prop = d->property(property);
 
         if (prop.isValid()) {
-            QQuickAction a;
+            QQuickStateAction a;
             a.restore = restoreEntryValues();
             a.property = prop;
             a.fromValue = a.property.read();
@@ -607,7 +607,7 @@ void QQuickPropertyChanges::changeValue(const QString &name, const QVariant &val
         }
     }
 
-    QQuickAction action;
+    QQuickStateAction action;
     action.restore = restoreEntryValues();
     action.property = d->property(name);
     action.fromValue = action.property.read();
@@ -678,7 +678,7 @@ void QQuickPropertyChanges::changeExpression(const QString &name, const QString
             newBinding->setTarget(d->property(name));
             QQmlPropertyPrivate::setBinding(d->property(name), newBinding, QQmlPropertyPrivate::DontRemoveBinding | QQmlPropertyPrivate::BypassInterceptor);
         } else {
-            QQuickAction action;
+            QQuickStateAction action;
             action.restore = restoreEntryValues();
             action.property = d->property(name);
             action.fromValue = action.property.read();
index 504b598..2cc8a4e 100644 (file)
@@ -53,13 +53,13 @@ QT_BEGIN_NAMESPACE
 
 DEFINE_BOOL_CONFIG_OPTION(stateChangeDebug, STATECHANGE_DEBUG);
 
-QQuickAction::QQuickAction()
+QQuickStateAction::QQuickStateAction()
 : restore(true), actionDone(false), reverseEvent(false), deletableToBinding(false), fromBinding(0), event(0),
   specifiedObject(0)
 {
 }
 
-QQuickAction::QQuickAction(QObject *target, const QString &propertyName,
+QQuickStateAction::QQuickStateAction(QObject *target, const QString &propertyName,
                const QVariant &value)
 : restore(true), actionDone(false), reverseEvent(false), deletableToBinding(false),
   property(target, propertyName, qmlEngine(target)), toValue(value),
@@ -70,7 +70,7 @@ QQuickAction::QQuickAction(QObject *target, const QString &propertyName,
         fromValue = property.read();
 }
 
-QQuickAction::QQuickAction(QObject *target, const QString &propertyName,
+QQuickStateAction::QQuickStateAction(QObject *target, const QString &propertyName,
                QQmlContext *context, const QVariant &value)
 : restore(true), actionDone(false), reverseEvent(false), deletableToBinding(false),
   property(target, propertyName, context), toValue(value),
@@ -82,33 +82,33 @@ QQuickAction::QQuickAction(QObject *target, const QString &propertyName,
 }
 
 
-QQuickActionEvent::~QQuickActionEvent()
+QQuickStateActionEvent::~QQuickStateActionEvent()
 {
 }
 
-void QQuickActionEvent::execute(Reason)
+void QQuickStateActionEvent::execute(Reason)
 {
 }
 
-bool QQuickActionEvent::isReversable()
+bool QQuickStateActionEvent::isReversable()
 {
     return false;
 }
 
-void QQuickActionEvent::reverse(Reason)
+void QQuickStateActionEvent::reverse(Reason)
 {
 }
 
-bool QQuickActionEvent::changesBindings()
+bool QQuickStateActionEvent::changesBindings()
 {
     return false;
 }
 
-void QQuickActionEvent::clearBindings()
+void QQuickStateActionEvent::clearBindings()
 {
 }
 
-bool QQuickActionEvent::override(QQuickActionEvent *other)
+bool QQuickStateActionEvent::override(QQuickStateActionEvent *other)
 {
     Q_UNUSED(other);
     return false;
@@ -361,7 +361,7 @@ void QQuickState::cancel()
     d->transitionManager.cancel();
 }
 
-void QQuickAction::deleteFromBinding()
+void QQuickStateAction::deleteFromBinding()
 {
     if (fromBinding) {
         QQmlPropertyPrivate::setBinding(property, 0);
@@ -457,7 +457,7 @@ bool QQuickState::removeEntryFromRevertList(QObject *target, const QString &name
     return false;
 }
 
-void QQuickState::addEntryToRevertList(const QQuickAction &action)
+void QQuickState::addEntryToRevertList(const QQuickStateAction &action)
 {
     Q_D(QQuickState);
 
@@ -492,15 +492,15 @@ void QQuickState::removeAllEntriesFromRevertList(QObject *target)
      }
 }
 
-void QQuickState::addEntriesToRevertList(const QList<QQuickAction> &actionList)
+void QQuickState::addEntriesToRevertList(const QList<QQuickStateAction> &actionList)
 {
     Q_D(QQuickState);
     if (isStateActive()) {
         QList<QQuickSimpleAction> simpleActionList;
 
-        QListIterator<QQuickAction> actionListIterator(actionList);
+        QListIterator<QQuickStateAction> actionListIterator(actionList);
         while(actionListIterator.hasNext()) {
-            const QQuickAction &action = actionListIterator.next();
+            const QQuickStateAction &action = actionListIterator.next();
             QQuickSimpleAction simpleAction(action);
             action.property.write(action.toValue);
             if (!action.toBinding.isNull()) {
@@ -582,14 +582,14 @@ void QQuickState::apply(QQuickTransition *trans, QQuickState *revert)
     QQuickStatePrivate::SimpleActionList additionalReverts;
     // First add the reverse of all the applyList actions
     for (int ii = 0; ii < applyList.count(); ++ii) {
-        QQuickAction &action = applyList[ii];
+        QQuickStateAction &action = applyList[ii];
 
         if (action.event) {
             if (!action.event->isReversable())
                 continue;
             bool found = false;
             for (int jj = 0; jj < d->revertList.count(); ++jj) {
-                QQuickActionEvent *event = d->revertList.at(jj).event();
+                QQuickStateActionEvent *event = d->revertList.at(jj).event();
                 if (event && event->type() == action.event->type()) {
                     if (action.event->override(event)) {
                         found = true;
@@ -647,11 +647,11 @@ void QQuickState::apply(QQuickTransition *trans, QQuickState *revert)
     for (int ii = 0; ii < d->revertList.count(); ++ii) {
         bool found = false;
         if (d->revertList.at(ii).event()) {
-            QQuickActionEvent *event = d->revertList.at(ii).event();
+            QQuickStateActionEvent *event = d->revertList.at(ii).event();
             if (!event->isReversable())
                 continue;
             for (int jj = 0; !found && jj < applyList.count(); ++jj) {
-                const QQuickAction &action = applyList.at(jj);
+                const QQuickStateAction &action = applyList.at(jj);
                 if (action.event && action.event->type() == event->type()) {
                     if (action.event->override(event))
                         found = true;
@@ -659,7 +659,7 @@ void QQuickState::apply(QQuickTransition *trans, QQuickState *revert)
             }
         } else {
             for (int jj = 0; !found && jj < applyList.count(); ++jj) {
-                const QQuickAction &action = applyList.at(jj);
+                const QQuickStateAction &action = applyList.at(jj);
                 if (action.property == d->revertList.at(ii).property())
                     found = true;
             }
@@ -671,7 +671,7 @@ void QQuickState::apply(QQuickTransition *trans, QQuickState *revert)
             if (delBinding)
                 delBinding->destroy();
 
-            QQuickAction a;
+            QQuickStateAction a;
             a.property = d->revertList.at(ii).property();
             a.fromValue = cur;
             a.toValue = d->revertList.at(ii).value();
@@ -696,11 +696,11 @@ void QQuickState::apply(QQuickTransition *trans, QQuickState *revert)
 #ifndef QT_NO_DEBUG_STREAM
     // Output for debugging
     if (stateChangeDebug()) {
-        foreach(const QQuickAction &action, applyList) {
+        foreach(const QQuickStateAction &action, applyList) {
             if (action.event)
-                qWarning() << "    QQuickAction event:" << action.event->type();
+                qWarning() << "    QQuickStateAction event:" << action.event->type();
             else
-                qWarning() << "    QQuickAction:" << action.property.object()
+                qWarning() << "    QQuickStateAction:" << action.property.object()
                            << action.property.name() << "From:" << action.fromValue
                            << "To:" << action.toValue;
         }
index 0c843b5..7b00789 100644 (file)
 
 QT_BEGIN_NAMESPACE
 
-class QQuickActionEvent;
+class QQuickStateActionEvent;
 class QQmlAbstractBinding;
 class QQmlBinding;
 class QQmlExpression;
-class QQuickAction
+class QQuickStateAction
 {
 public:
-    QQuickAction();
-    QQuickAction(QObject *, const QString &, const QVariant &);
-    QQuickAction(QObject *, const QString &,
+    QQuickStateAction();
+    QQuickStateAction(QObject *, const QString &, const QVariant &);
+    QQuickStateAction(QObject *, const QString &,
                        QQmlContext *, const QVariant &);
 
     bool restore:1;
@@ -73,7 +73,7 @@ public:
 
     QQmlAbstractBinding *fromBinding;
     QWeakPointer<QQmlAbstractBinding> toBinding;
-    QQuickActionEvent *event;
+    QQuickStateActionEvent *event;
 
     //strictly for matching
     QObject *specifiedObject;
@@ -82,10 +82,10 @@ public:
     void deleteFromBinding();
 };
 
-class Q_AUTOTEST_EXPORT QQuickActionEvent
+class Q_AUTOTEST_EXPORT QQuickStateActionEvent
 {
 public:
-    virtual ~QQuickActionEvent();
+    virtual ~QQuickStateActionEvent();
 
     enum EventType { Script, SignalHandler, ParentChange, AnchorChanges };
     enum Reason { ActualChange, FastForward };
@@ -97,7 +97,7 @@ public:
     virtual void reverse(Reason reason = ActualChange);
     virtual void saveOriginals() {}
     virtual bool needsCopy() { return false; }
-    virtual void copyOriginals(QQuickActionEvent *) {}
+    virtual void copyOriginals(QQuickStateActionEvent *) {}
 
     virtual bool isRewindable() { return isReversable(); }
     virtual void rewind() {}
@@ -106,7 +106,7 @@ public:
 
     virtual bool changesBindings();
     virtual void clearBindings();
-    virtual bool override(QQuickActionEvent*other);
+    virtual bool override(QQuickStateActionEvent*other);
 };
 
 //### rename to QQuickStateChange?
@@ -119,7 +119,7 @@ class Q_QUICK_PRIVATE_EXPORT QQuickStateOperation : public QObject
 public:
     QQuickStateOperation(QObject *parent = 0)
         : QObject(parent) {}
-    typedef QList<QQuickAction> ActionList;
+    typedef QList<QQuickStateAction> ActionList;
 
     virtual ActionList actions();
 
@@ -182,9 +182,9 @@ public:
     bool changeValueInRevertList(QObject *target, const QString &name, const QVariant &revertValue);
     bool changeBindingInRevertList(QObject *target, const QString &name, QQmlAbstractBinding *binding);
     bool removeEntryFromRevertList(QObject *target, const QString &name);
-    void addEntryToRevertList(const QQuickAction &action);
+    void addEntryToRevertList(const QQuickStateAction &action);
     void removeAllEntriesFromRevertList(QObject *target);
-    void addEntriesToRevertList(const QList<QQuickAction> &actions);
+    void addEntriesToRevertList(const QList<QQuickStateAction> &actions);
     QVariant valueInRevertList(QObject *target, const QString &name) const;
     QQmlAbstractBinding *bindingInRevertList(QObject *target, const QString &name) const;
 
index 8dfc6eb..c559c81 100644 (file)
@@ -70,7 +70,7 @@ class QQuickSimpleAction
 {
 public:
     enum State { StartState, EndState };
-    QQuickSimpleAction(const QQuickAction &a, State state = StartState)
+    QQuickSimpleAction(const QQuickStateAction &a, State state = StartState)
     {
         m_property = a.property;
         m_specifiedObject = a.specifiedObject;
@@ -157,7 +157,7 @@ public:
         return m_specifiedProperty;
     }
 
-    QQuickActionEvent *event() const
+    QQuickStateActionEvent *event() const
     {
         return m_event;
     }
@@ -173,7 +173,7 @@ private:
     QQmlAbstractBinding::Pointer m_binding;
     QObject *m_specifiedObject;
     QString m_specifiedProperty;
-    QQuickActionEvent *m_event;
+    QQuickStateActionEvent *m_event;
     bool m_reverseEvent;
 };
 
@@ -182,9 +182,9 @@ class QQuickRevertAction
 public:
     QQuickRevertAction() : event(0) {}
     QQuickRevertAction(const QQmlProperty &prop) : property(prop), event(0) {}
-    QQuickRevertAction(QQuickActionEvent *e) : event(e) {}
+    QQuickRevertAction(QQuickStateActionEvent *e) : event(e) {}
     QQmlProperty property;
-    QQuickActionEvent *event;
+    QQuickStateActionEvent *event;
 };
 
 class QQuickStateOperationPrivate : public QObjectPrivate
index 51b3791..7fe0b01 100644 (file)
@@ -140,13 +140,13 @@ void QQuickStateChangeScript::execute(Reason)
 QQuickStateChangeScript::ActionList QQuickStateChangeScript::actions()
 {
     ActionList rv;
-    QQuickAction a;
+    QQuickStateAction a;
     a.event = this;
     rv << a;
     return rv;
 }
 
-QQuickActionEvent::EventType QQuickStateChangeScript::type() const
+QQuickStateActionEvent::EventType QQuickStateChangeScript::type() const
 {
     return Script;
 }
index 29755b1..1366002 100644 (file)
@@ -48,7 +48,7 @@
 QT_BEGIN_NAMESPACE
 
 class QQuickStateChangeScriptPrivate;
-class Q_AUTOTEST_EXPORT QQuickStateChangeScript : public QQuickStateOperation, public QQuickActionEvent
+class Q_AUTOTEST_EXPORT QQuickStateChangeScript : public QQuickStateOperation, public QQuickStateActionEvent
 {
     Q_OBJECT
     Q_DECLARE_PRIVATE(QQuickStateChangeScript)
index 1946ec9..769dadc 100644 (file)
@@ -108,7 +108,7 @@ void QQuickTransitionManager::complete()
 
 void QQuickTransitionManagerPrivate::applyBindings()
 {
-    foreach(const QQuickAction &action, bindingsList) {
+    foreach(const QQuickStateAction &action, bindingsList) {
         if (!action.toBinding.isNull()) {
             QQmlPropertyPrivate::setBinding(action.property, action.toBinding.data());
         } else if (action.event) {
@@ -127,7 +127,7 @@ void QQuickTransitionManager::finished()
 {
 }
 
-void QQuickTransitionManager::transition(const QList<QQuickAction> &list,
+void QQuickTransitionManager::transition(const QList<QQuickStateAction> &list,
                                       QQuickTransition *transition,
                                       QObject *defaultTarget)
 {
@@ -135,7 +135,7 @@ void QQuickTransitionManager::transition(const QList<QQuickAction> &list,
 
     QQuickStateOperation::ActionList applyList = list;
     // Determine which actions are binding changes and disable any current bindings
-    foreach(const QQuickAction &action, applyList) {
+    foreach(const QQuickStateAction &action, applyList) {
         if (action.toBinding)
             d->bindingsList << action;
         if (action.fromBinding)
@@ -162,22 +162,22 @@ void QQuickTransitionManager::transition(const QList<QQuickAction> &list,
 
         // Apply all the property and binding changes
         for (int ii = 0; ii < applyList.size(); ++ii) {
-            const QQuickAction &action = applyList.at(ii);
+            const QQuickStateAction &action = applyList.at(ii);
             if (!action.toBinding.isNull()) {
                 QQmlPropertyPrivate::setBinding(action.property, action.toBinding.data(), QQmlPropertyPrivate::BypassInterceptor | QQmlPropertyPrivate::DontRemoveBinding);
             } else if (!action.event) {
                 QQmlPropertyPrivate::write(action.property, action.toValue, QQmlPropertyPrivate::BypassInterceptor | QQmlPropertyPrivate::DontRemoveBinding);
             } else if (action.event->isReversable()) {
                 if (action.reverseEvent)
-                    action.event->reverse(QQuickActionEvent::FastForward);
+                    action.event->reverse(QQuickStateActionEvent::FastForward);
                 else
-                    action.event->execute(QQuickActionEvent::FastForward);
+                    action.event->execute(QQuickStateActionEvent::FastForward);
             }
         }
 
         // Read all the end values for binding changes
         for (int ii = 0; ii < applyList.size(); ++ii) {
-            QQuickAction *action = &applyList[ii];
+            QQuickStateAction *action = &applyList[ii];
             if (action->event) {
                 action->event->saveTargetValues();
                 continue;
@@ -189,7 +189,7 @@ void QQuickTransitionManager::transition(const QList<QQuickAction> &list,
         }
 
         // Revert back to the original values
-        foreach(const QQuickAction &action, applyList) {
+        foreach(const QQuickStateAction &action, applyList) {
             if (action.event) {
                 if (action.event->isReversable()) {
                     action.event->clearBindings();
@@ -216,7 +216,7 @@ void QQuickTransitionManager::transition(const QList<QQuickAction> &list,
 
         // Modify the action list to remove actions handled in the transition
         for (int ii = 0; ii < applyList.count(); ++ii) {
-            const QQuickAction &action = applyList.at(ii);
+            const QQuickStateAction &action = applyList.at(ii);
 
             if (action.event) {
 
@@ -244,7 +244,7 @@ void QQuickTransitionManager::transition(const QList<QQuickAction> &list,
     // be applied immediately.  We skip applying bindings, as they are all
     // applied at the end in applyBindings() to avoid any nastiness mid 
     // transition
-    foreach(const QQuickAction &action, applyList) {
+    foreach(const QQuickStateAction &action, applyList) {
         if (action.event && !action.event->changesBindings()) {
             if (action.event->isReversable() && action.reverseEvent)
                 action.event->reverse();
@@ -256,7 +256,7 @@ void QQuickTransitionManager::transition(const QList<QQuickAction> &list,
     }
 #ifndef QT_NO_DEBUG_STREAM
     if (stateChangeDebug()) {
-        foreach(const QQuickAction &action, applyList) {
+        foreach(const QQuickStateAction &action, applyList) {
             if (action.event)
                 qWarning() << "    No transition for event:" << action.event->type();
             else
@@ -276,7 +276,7 @@ void QQuickTransitionManager::cancel()
         d->transitionInstance->stop();
 
     for(int i = 0; i < d->bindingsList.count(); ++i) {
-        QQuickAction action = d->bindingsList[i];
+        QQuickStateAction action = d->bindingsList[i];
         if (!action.toBinding.isNull() && action.deletableToBinding) {
             QQmlPropertyPrivate::setBinding(action.property, 0);
             action.toBinding.data()->destroy();
index 6962ee6..6211b54 100644 (file)
@@ -68,7 +68,7 @@ public:
 
     bool isRunning() const;
 
-    void transition(const QList<QQuickAction> &, QQuickTransition *transition, QObject *defaultTarget = 0);
+    void transition(const QList<QQuickStateAction> &, QQuickTransition *transition, QObject *defaultTarget = 0);
 
     void cancel();