From 8598114e3379df3a73d4ccc7760e3761ed55edf0 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Fri, 21 Aug 2009 14:33:38 +1000 Subject: SetPropertyAction -> PropertyAction --- demos/declarative/flickr/content/ImageDetails.qml | 4 +- demos/declarative/flickr/flickr.qml | 2 +- demos/declarative/flickr/flickr2.qml | 6 +- demos/declarative/webbrowser/webbrowser.qml | 4 +- doc/src/declarative/elements.qdoc | 2 +- examples/declarative/behaviours/test.qml | 2 +- examples/declarative/fillmode/fillmode.qml | 24 +++---- examples/declarative/follow/pong.qml | 4 +- examples/declarative/snow/ImageBatch.qml | 6 +- src/declarative/QmlChanges.txt | 1 + src/declarative/util/qmlanimation.cpp | 76 +++++++++++------------ src/declarative/util/qmlanimation.h | 12 ++-- src/declarative/util/qmlanimation_p.h | 10 +-- 13 files changed, 77 insertions(+), 76 deletions(-) diff --git a/demos/declarative/flickr/content/ImageDetails.qml b/demos/declarative/flickr/content/ImageDetails.qml index 5db1e99..8098273 100644 --- a/demos/declarative/flickr/content/ImageDetails.qml +++ b/demos/declarative/flickr/content/ImageDetails.qml @@ -143,13 +143,13 @@ Flipable { transitions: [ Transition { SequentialAnimation { - SetPropertyAction { + PropertyAction { target: BigImage property: "smooth" value: false } NumberAnimation { easing: "easeInOutQuad"; properties: "angle"; duration: 500 } - SetPropertyAction { + PropertyAction { target: BigImage property: "smooth" value: !Flick.moving diff --git a/demos/declarative/flickr/flickr.qml b/demos/declarative/flickr/flickr.qml index 06a2698..d3c1a48 100644 --- a/demos/declarative/flickr/flickr.qml +++ b/demos/declarative/flickr/flickr.qml @@ -109,7 +109,7 @@ Item { SequentialAnimation { ParentAction { } NumberAnimation { properties: "x,y,scale,opacity,angle"; duration: 500; easing: "easeInOutQuad" } - SetPropertyAction { target: Wrapper; properties: "z" } + PropertyAction { target: Wrapper; properties: "z" } } } ] diff --git a/demos/declarative/flickr/flickr2.qml b/demos/declarative/flickr/flickr2.qml index c4af5df..0bdbaaf 100644 --- a/demos/declarative/flickr/flickr2.qml +++ b/demos/declarative/flickr/flickr2.qml @@ -108,7 +108,7 @@ Item { SequentialAnimation { ParentAction { } NumberAnimation { properties: "x,y,scale,opacity,angle"; duration: 500; easing: "easeInOutQuad" } - SetPropertyAction { target: Wrapper; properties: "z" } + PropertyAction { target: Wrapper; properties: "z" } } } ] @@ -142,7 +142,7 @@ Item { Transition { toState: "pathView" SequentialAnimation { - SetPropertyAction { target: Wrapper; property: "moveToParent" } + PropertyAction { target: Wrapper; property: "moveToParent" } ParallelAnimation { NumberAnimation { target: Wrapper @@ -159,7 +159,7 @@ Item { toState: "gridView" SequentialAnimation { PauseAnimation { duration: Math.floor(index/7)*100 } - SetPropertyAction { target: Wrapper; property: "moveToParent" } + PropertyAction { target: Wrapper; property: "moveToParent" } ParallelAnimation { NumberAnimation { target: Wrapper diff --git a/demos/declarative/webbrowser/webbrowser.qml b/demos/declarative/webbrowser/webbrowser.qml index 2e57c72..232871f 100644 --- a/demos/declarative/webbrowser/webbrowser.qml +++ b/demos/declarative/webbrowser/webbrowser.qml @@ -353,7 +353,7 @@ Item { transitions: [ Transition { SequentialAnimation { - SetPropertyAction { + PropertyAction { target: MyWebView property: "smooth" value: false @@ -372,7 +372,7 @@ Item { duration: 200 } } - SetPropertyAction { + PropertyAction { target: MyWebView property: "smooth" value: !Flick.moving diff --git a/doc/src/declarative/elements.qdoc b/doc/src/declarative/elements.qdoc index 588ca86..6a285ba 100644 --- a/doc/src/declarative/elements.qdoc +++ b/doc/src/declarative/elements.qdoc @@ -32,7 +32,7 @@ The following table lists the QML elements provided by the Qt Declarative module \o \l PauseAnimation \o \l SequentialAnimation \o \l ParallelAnimation -\o \l SetPropertyAction +\o \l PropertyAction \o \l ParentAction \o \l ScriptAction \o \l Transition diff --git a/examples/declarative/behaviours/test.qml b/examples/declarative/behaviours/test.qml index cac2f9d..1dd0658 100644 --- a/examples/declarative/behaviours/test.qml +++ b/examples/declarative/behaviours/test.qml @@ -85,7 +85,7 @@ Rectangle { to: 0 duration: 150 } - SetPropertyAction {} + PropertyAction {} NumberAnimation { target: bluerect properties: "opacity" diff --git a/examples/declarative/fillmode/fillmode.qml b/examples/declarative/fillmode/fillmode.qml index de60b28..94b0782 100644 --- a/examples/declarative/fillmode/fillmode.qml +++ b/examples/declarative/fillmode/fillmode.qml @@ -7,23 +7,23 @@ Image { fillMode: SequentialAnimation { running: true repeat: true - SetPropertyAction { value: "Stretch" } - SetPropertyAction { target: Label; property: "text"; value: "Stretch" } + PropertyAction { value: "Stretch" } + PropertyAction { target: Label; property: "text"; value: "Stretch" } PauseAnimation { duration: 1000 } - SetPropertyAction { value: "PreserveAspectFit" } - SetPropertyAction { target: Label; property: "text"; value: "PreserveAspectFit" } + PropertyAction { value: "PreserveAspectFit" } + PropertyAction { target: Label; property: "text"; value: "PreserveAspectFit" } PauseAnimation { duration: 1000 } - SetPropertyAction { value: "PreserveAspectCrop" } - SetPropertyAction { target: Label; property: "text"; value: "PreserveAspectCrop" } + PropertyAction { value: "PreserveAspectCrop" } + PropertyAction { target: Label; property: "text"; value: "PreserveAspectCrop" } PauseAnimation { duration: 1000 } - SetPropertyAction { value: "Tile" } - SetPropertyAction { target: Label; property: "text"; value: "Tile" } + PropertyAction { value: "Tile" } + PropertyAction { target: Label; property: "text"; value: "Tile" } PauseAnimation { duration: 1000 } - SetPropertyAction { value: "TileHorizontally" } - SetPropertyAction { target: Label; property: "text"; value: "TileHorizontally" } + PropertyAction { value: "TileHorizontally" } + PropertyAction { target: Label; property: "text"; value: "TileHorizontally" } PauseAnimation { duration: 1000 } - SetPropertyAction { value: "TileVertically" } - SetPropertyAction { target: Label; property: "text"; value: "TileVertically" } + PropertyAction { value: "TileVertically" } + PropertyAction { target: Label; property: "text"; value: "TileVertically" } PauseAnimation { duration: 1000 } } Text { diff --git a/examples/declarative/follow/pong.qml b/examples/declarative/follow/pong.qml index 6146f1a..d2aaba9 100644 --- a/examples/declarative/follow/pong.qml +++ b/examples/declarative/follow/pong.qml @@ -19,9 +19,9 @@ Rectangle { x: SequentialAnimation { running: true; repeat: true NumberAnimation { to: Page.width-40; duration: 2000 } - SetPropertyAction { target: Ball; property: "direction"; value: "left" } + PropertyAction { target: Ball; property: "direction"; value: "left" } NumberAnimation { to: 20; duration: 2000 } - SetPropertyAction { target: Ball; property: "direction"; value: "right" } + PropertyAction { target: Ball; property: "direction"; value: "right" } } // Make y follow the target y coordinate, with a velocity of 200 diff --git a/examples/declarative/snow/ImageBatch.qml b/examples/declarative/snow/ImageBatch.qml index 4cf4259..17e5a48 100644 --- a/examples/declarative/snow/ImageBatch.qml +++ b/examples/declarative/snow/ImageBatch.qml @@ -23,7 +23,7 @@ GridView { transitions: Transition { SequentialAnimation { PauseAnimation { duration: 150 } - SetPropertyAction { properties: "z" } + PropertyAction { properties: "z" } } } model: XmlListModel { @@ -55,7 +55,7 @@ GridView { toState: "selected" SequentialAnimation { PauseAnimation { duration: 150 } - SetPropertyAction { properties: "z" } + PropertyAction { properties: "z" } NumberAnimation { properties: "scale"; duration: 150; } } }, @@ -63,7 +63,7 @@ GridView { fromState: "selected" SequentialAnimation { NumberAnimation { properties: "scale"; duration: 150 } - SetPropertyAction { properties: "z" } + PropertyAction { properties: "z" } } } ] diff --git a/src/declarative/QmlChanges.txt b/src/declarative/QmlChanges.txt index 1465b14..0f1bd1b 100644 --- a/src/declarative/QmlChanges.txt +++ b/src/declarative/QmlChanges.txt @@ -20,6 +20,7 @@ Bind -> Binding SetProperties -> PropertyChanges RunScript -> StateChangeScript SetAnchors -> AnchorChanges +SetPropertyAction -> PropertyAction RunScriptAction -> ScriptAction ParentChangeAction -> ParentAction diff --git a/src/declarative/util/qmlanimation.cpp b/src/declarative/util/qmlanimation.cpp index c89b0ce..720a045 100644 --- a/src/declarative/util/qmlanimation.cpp +++ b/src/declarative/util/qmlanimation.cpp @@ -422,7 +422,7 @@ void QmlAbstractAnimation::setGroup(QmlAnimationGroup *g) } /*! - \qmlproperty Object SetPropertyAction::target + \qmlproperty Object PropertyAction::target This property holds an explicit target object to animate. The exact effect of the \c target property depends on how the animation @@ -459,7 +459,7 @@ void QmlAbstractAnimation::setTarget(QObject *o) } /*! - \qmlproperty string SetPropertyAction::property + \qmlproperty string PropertyAction::property This property holds an explicit property to animated. The exact effect of the \c property property depends on how the animation @@ -870,58 +870,58 @@ QAbstractAnimation *QmlScriptAction::qtAnimation() QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,ScriptAction,QmlScriptAction) /*! - \qmlclass SetPropertyAction QmlSetPropertyAction + \qmlclass PropertyAction QmlPropertyAction \inherits Animation - \brief The SetPropertyAction allows immediate property changes during animation. + \brief The PropertyAction allows immediate property changes during animation. Explicitly set \c theimage.smooth=true during a transition: \code - SetPropertyAction { target: theimage; property: "smooth"; value: true } + PropertyAction { target: theimage; property: "smooth"; value: true } \endcode Set \c thewebview.url to the value set for the destination state: \code - SetPropertyAction { target: thewebview; property: "url" } + PropertyAction { target: thewebview; property: "url" } \endcode - The SetPropertyAction is immediate - + The PropertyAction is immediate - the target property is not animated to the selected value in any way. */ /*! \internal - \class QmlSetPropertyAction + \class QmlPropertyAction */ -QmlSetPropertyAction::QmlSetPropertyAction(QObject *parent) -: QmlAbstractAnimation(*(new QmlSetPropertyActionPrivate), parent) +QmlPropertyAction::QmlPropertyAction(QObject *parent) +: QmlAbstractAnimation(*(new QmlPropertyActionPrivate), parent) { - Q_D(QmlSetPropertyAction); + Q_D(QmlPropertyAction); d->init(); } -QmlSetPropertyAction::~QmlSetPropertyAction() +QmlPropertyAction::~QmlPropertyAction() { } -void QmlSetPropertyActionPrivate::init() +void QmlPropertyActionPrivate::init() { - Q_Q(QmlSetPropertyAction); + Q_Q(QmlPropertyAction); spa = new QActionAnimation; QFx_setParent_noEvent(spa, q); } /*! - \qmlproperty string SetPropertyAction::properties + \qmlproperty string PropertyAction::properties This property holds the properties to be immediately set, comma-separated. */ -QString QmlSetPropertyAction::properties() const +QString QmlPropertyAction::properties() const { - Q_D(const QmlSetPropertyAction); + Q_D(const QmlPropertyAction); return d->properties; } -void QmlSetPropertyAction::setProperties(const QString &p) +void QmlPropertyAction::setProperties(const QString &p) { - Q_D(QmlSetPropertyAction); + Q_D(QmlPropertyAction); if (d->properties == p) return; d->properties = p; @@ -929,61 +929,61 @@ void QmlSetPropertyAction::setProperties(const QString &p) } /*! - \qmlproperty list SetPropertyAction::targets + \qmlproperty list PropertyAction::targets This property holds the items selected to be affected by this animation (all if not set). \sa exclude */ -QList *QmlSetPropertyAction::targets() +QList *QmlPropertyAction::targets() { - Q_D(QmlSetPropertyAction); + Q_D(QmlPropertyAction); return &d->targets; } /*! - \qmlproperty list SetPropertyAction::exclude + \qmlproperty list PropertyAction::exclude This property holds the items not to be affected by this animation. \sa targets */ -QList *QmlSetPropertyAction::exclude() +QList *QmlPropertyAction::exclude() { - Q_D(QmlSetPropertyAction); + Q_D(QmlPropertyAction); return &d->exclude; } /*! - \qmlproperty any SetPropertyAction::value + \qmlproperty any PropertyAction::value This property holds the value to be set on the property. If not set, then the value defined for the end state of the transition. */ -QVariant QmlSetPropertyAction::value() const +QVariant QmlPropertyAction::value() const { - Q_D(const QmlSetPropertyAction); + Q_D(const QmlPropertyAction); return d->value; } -void QmlSetPropertyAction::setValue(const QVariant &v) +void QmlPropertyAction::setValue(const QVariant &v) { - Q_D(QmlSetPropertyAction); + Q_D(QmlPropertyAction); if (d->value.isNull || d->value != v) { d->value = v; emit valueChanged(v); } } -void QmlSetPropertyActionPrivate::doAction() +void QmlPropertyActionPrivate::doAction() { property.write(value); } -QAbstractAnimation *QmlSetPropertyAction::qtAnimation() +QAbstractAnimation *QmlPropertyAction::qtAnimation() { - Q_D(QmlSetPropertyAction); + Q_D(QmlPropertyAction); return d->spa; } -void QmlSetPropertyAction::prepare(QmlMetaProperty &p) +void QmlPropertyAction::prepare(QmlMetaProperty &p) { - Q_D(QmlSetPropertyAction); + Q_D(QmlPropertyAction); if (d->userProperty.isNull) d->property = p; @@ -993,11 +993,11 @@ void QmlSetPropertyAction::prepare(QmlMetaProperty &p) d->spa->setAnimAction(&d->proxy, QAbstractAnimation::KeepWhenStopped); } -void QmlSetPropertyAction::transition(QmlStateActions &actions, +void QmlPropertyAction::transition(QmlStateActions &actions, QmlMetaProperties &modified, TransitionDirection direction) { - Q_D(QmlSetPropertyAction); + Q_D(QmlPropertyAction); Q_UNUSED(direction); struct QmlSetPropertyAnimationAction : public QAbstractAnimationAction @@ -1072,7 +1072,7 @@ void QmlSetPropertyAction::transition(QmlStateActions &actions, } } -QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,SetPropertyAction,QmlSetPropertyAction) +QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,PropertyAction,QmlPropertyAction) /*! \qmlclass ParentAction QmlParentAction diff --git a/src/declarative/util/qmlanimation.h b/src/declarative/util/qmlanimation.h index e27c899..f5180a5 100644 --- a/src/declarative/util/qmlanimation.h +++ b/src/declarative/util/qmlanimation.h @@ -186,11 +186,11 @@ protected: virtual QAbstractAnimation *qtAnimation(); }; -class QmlSetPropertyActionPrivate; -class QmlSetPropertyAction : public QmlAbstractAnimation +class QmlPropertyActionPrivate; +class QmlPropertyAction : public QmlAbstractAnimation { Q_OBJECT - Q_DECLARE_PRIVATE(QmlSetPropertyAction) + Q_DECLARE_PRIVATE(QmlPropertyAction) Q_PROPERTY(QObject *target READ target WRITE setTarget NOTIFY targetChanged) Q_PROPERTY(QString property READ property WRITE setProperty NOTIFY targetChanged) @@ -200,8 +200,8 @@ class QmlSetPropertyAction : public QmlAbstractAnimation Q_PROPERTY(QVariant value READ value WRITE setValue NOTIFY valueChanged) public: - QmlSetPropertyAction(QObject *parent=0); - virtual ~QmlSetPropertyAction(); + QmlPropertyAction(QObject *parent=0); + virtual ~QmlPropertyAction(); QString properties() const; void setProperties(const QString &); @@ -396,7 +396,7 @@ QT_END_NAMESPACE QML_DECLARE_TYPE(QmlAbstractAnimation) QML_DECLARE_TYPE(QmlPauseAnimation) QML_DECLARE_TYPE(QmlScriptAction) -QML_DECLARE_TYPE(QmlSetPropertyAction) +QML_DECLARE_TYPE(QmlPropertyAction) QML_DECLARE_TYPE(QmlParentAction) QML_DECLARE_TYPE(QmlPropertyAnimation) QML_DECLARE_TYPE(QmlColorAnimation) diff --git a/src/declarative/util/qmlanimation_p.h b/src/declarative/util/qmlanimation_p.h index b81f5ae..4f6edb7 100644 --- a/src/declarative/util/qmlanimation_p.h +++ b/src/declarative/util/qmlanimation_p.h @@ -240,11 +240,11 @@ public: QActionAnimation *rsa; }; -class QmlSetPropertyActionPrivate : public QmlAbstractAnimationPrivate +class QmlPropertyActionPrivate : public QmlAbstractAnimationPrivate { - Q_DECLARE_PUBLIC(QmlSetPropertyAction) + Q_DECLARE_PUBLIC(QmlPropertyAction) public: - QmlSetPropertyActionPrivate() + QmlPropertyActionPrivate() : QmlAbstractAnimationPrivate(), proxy(this), spa(0) {} void init(); @@ -257,8 +257,8 @@ public: void doAction(); - QAnimationActionProxy proxy; + QAnimationActionProxy proxy; QActionAnimation *spa; }; -- cgit v0.12