summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2009-08-21 03:51:24 (GMT)
committerMartin Jones <martin.jones@nokia.com>2009-08-21 03:51:24 (GMT)
commitbc5b2b8ea1259bffdbdafe9d509fc675476fdb97 (patch)
tree719a93d4ad493f0c47943ee380bda6935d0fe94a
parentaf23b7a78ce50d747efc06cd26ea5b69349df811 (diff)
downloadQt-bc5b2b8ea1259bffdbdafe9d509fc675476fdb97.zip
Qt-bc5b2b8ea1259bffdbdafe9d509fc675476fdb97.tar.gz
Qt-bc5b2b8ea1259bffdbdafe9d509fc675476fdb97.tar.bz2
Renamed transition action elements
RunScriptAction -> ScriptAction ParentChangeAction -> ParentAction
-rw-r--r--demos/declarative/flickr/flickr.qml4
-rw-r--r--demos/declarative/flickr/flickr2.qml4
-rw-r--r--doc/src/declarative/animation.qdoc5
-rw-r--r--doc/src/declarative/elements.qdoc8
-rw-r--r--doc/src/declarative/qmlintro.qdoc8
-rw-r--r--doc/src/declarative/tutorial3.qdoc6
-rw-r--r--examples/declarative/flowview/flowview.qml4
-rw-r--r--examples/declarative/minehunt/minehunt.qml2
-rw-r--r--src/declarative/QmlChanges.txt4
-rw-r--r--src/declarative/util/qmlanimation.cpp110
-rw-r--r--src/declarative/util/qmlanimation.h24
-rw-r--r--src/declarative/util/qmlanimation_p.h16
12 files changed, 96 insertions, 99 deletions
diff --git a/demos/declarative/flickr/flickr.qml b/demos/declarative/flickr/flickr.qml
index 81134d3..06a2698 100644
--- a/demos/declarative/flickr/flickr.qml
+++ b/demos/declarative/flickr/flickr.qml
@@ -101,13 +101,13 @@ Item {
transitions: [
Transition {
fromState: "*"; toState: "Details"
- ParentChangeAction { }
+ ParentAction { }
NumberAnimation { properties: "x,y,scale,opacity,angle"; duration: 500; easing: "easeInOutQuad" }
},
Transition {
fromState: "Details"; toState: "*"
SequentialAnimation {
- ParentChangeAction { }
+ ParentAction { }
NumberAnimation { properties: "x,y,scale,opacity,angle"; duration: 500; easing: "easeInOutQuad" }
SetPropertyAction { target: Wrapper; properties: "z" }
}
diff --git a/demos/declarative/flickr/flickr2.qml b/demos/declarative/flickr/flickr2.qml
index 1c28d51..c4af5df 100644
--- a/demos/declarative/flickr/flickr2.qml
+++ b/demos/declarative/flickr/flickr2.qml
@@ -100,13 +100,13 @@ Item {
transitions: [
Transition {
fromState: "*"; toState: "Details"
- ParentChangeAction { }
+ ParentAction { }
NumberAnimation { properties: "x,y,scale,opacity,angle"; duration: 500; easing: "easeInOutQuad" }
},
Transition {
fromState: "Details"; toState: "*"
SequentialAnimation {
- ParentChangeAction { }
+ ParentAction { }
NumberAnimation { properties: "x,y,scale,opacity,angle"; duration: 500; easing: "easeInOutQuad" }
SetPropertyAction { target: Wrapper; properties: "z" }
}
diff --git a/doc/src/declarative/animation.qdoc b/doc/src/declarative/animation.qdoc
index eea0fc3..28a3c47 100644
--- a/doc/src/declarative/animation.qdoc
+++ b/doc/src/declarative/animation.qdoc
@@ -89,12 +89,9 @@ Item {
states: [
State {
name: "moved"
- SetProperties {
+ PropertyChanges {
target: myrect
x: 50
- }
- SetProperties {
- target: myrect
y: 50
}
}
diff --git a/doc/src/declarative/elements.qdoc b/doc/src/declarative/elements.qdoc
index aef05d7..588ca86 100644
--- a/doc/src/declarative/elements.qdoc
+++ b/doc/src/declarative/elements.qdoc
@@ -18,9 +18,10 @@ The following table lists the QML elements provided by the Qt Declarative module
\o
\list
\o \l State
-\o \l SetProperties
+\o \l PropertyChanges
\o \l ParentChange
-\o \l RunScript
+\o \l StateChangeScript
+\o \l AnchorChanges
\endlist
\o
@@ -32,7 +33,8 @@ The following table lists the QML elements provided by the Qt Declarative module
\o \l SequentialAnimation
\o \l ParallelAnimation
\o \l SetPropertyAction
-\o \l ParentChangeAction
+\o \l ParentAction
+\o \l ScriptAction
\o \l Transition
\o \l Behavior
\o \l Follow
diff --git a/doc/src/declarative/qmlintro.qdoc b/doc/src/declarative/qmlintro.qdoc
index fec8f11..41da36e 100644
--- a/doc/src/declarative/qmlintro.qdoc
+++ b/doc/src/declarative/qmlintro.qdoc
@@ -201,8 +201,8 @@ If a list property has been the default property, it means the property tag can
\code
State {
changes: [
- SetProperties {},
- SetProperties {}
+ PropertyChanges {},
+ PropertyChanges {}
]
}
\endcode
@@ -211,8 +211,8 @@ can be simplified to
\code
State {
- SetProperties {}
- SetProperties {}
+ PropertyChanges {}
+ PropertyChanges {}
}
\endcode
diff --git a/doc/src/declarative/tutorial3.qdoc b/doc/src/declarative/tutorial3.qdoc
index 3517f97..d402a66 100644
--- a/doc/src/declarative/tutorial3.qdoc
+++ b/doc/src/declarative/tutorial3.qdoc
@@ -28,8 +28,7 @@ Rectangle {
State {
name: "down"
when: MouseRegion.pressed == true
- SetProperties { target: HelloText; y: 160 }
- SetProperties { target: HelloText color: "red" }
+ PropertyChanges { target: HelloText; y: 160; color: "red" }
}
]
transitions: [
@@ -72,8 +71,7 @@ states: [
State {
name: "down"
when: MouseRegion.pressed == true
- SetProperties { target: HelloText; y: 160 }
- SetProperties { target: HelloText; color: "red" }
+ PropertyChanges { target: HelloText; y: 160; color: "red" }
}
]
\endcode
diff --git a/examples/declarative/flowview/flowview.qml b/examples/declarative/flowview/flowview.qml
index 9405e61..e82561e 100644
--- a/examples/declarative/flowview/flowview.qml
+++ b/examples/declarative/flowview/flowview.qml
@@ -66,7 +66,7 @@ Rectangle {
Transition {
fromState: "*"; toState: "InGrid"
SequentialAnimation {
- ParentChangeAction{}
+ ParentAction{}
PauseAnimation { duration: 50 * List.FlowView.column }
NumberAnimation { properties: "x,y,rotation"; easing: "easeInOutQuad" }
}
@@ -74,7 +74,7 @@ Rectangle {
Transition {
fromState: "*"; toState: "InList"
SequentialAnimation {
- ParentChangeAction{}
+ ParentAction{}
PauseAnimation { duration: 50 * (Grid.FlowView.row * 2 + Grid.FlowView.column) }
NumberAnimation { properties: "x,y,rotation"; easing: "easeInOutQuad" }
}
diff --git a/examples/declarative/minehunt/minehunt.qml b/examples/declarative/minehunt/minehunt.qml
index ac1b398..11748a8 100644
--- a/examples/declarative/minehunt/minehunt.qml
+++ b/examples/declarative/minehunt/minehunt.qml
@@ -94,7 +94,7 @@ Item {
easing: "easeInOutQuad"
properties: "angle"
}
- RunScriptAction{
+ ScriptAction{
script: if(modelData.hasMine && modelData.flipped)
{expl.explode = true;}
}
diff --git a/src/declarative/QmlChanges.txt b/src/declarative/QmlChanges.txt
index c3bd1d2..1465b14 100644
--- a/src/declarative/QmlChanges.txt
+++ b/src/declarative/QmlChanges.txt
@@ -20,6 +20,8 @@ Bind -> Binding
SetProperties -> PropertyChanges
RunScript -> StateChangeScript
SetAnchors -> AnchorChanges
+RunScriptAction -> ScriptAction
+ParentChangeAction -> ParentAction
Renamed properties:
MouseRegion: xmin -> minimumX
@@ -52,8 +54,6 @@ Pending Changes
===============
Renamed elements:
-RunScriptAction -> ScriptAction
-ParentChangeAction -> ParentAction
Renamed properties:
Transition: fromState -> from
diff --git a/src/declarative/util/qmlanimation.cpp b/src/declarative/util/qmlanimation.cpp
index 0e93cc7..c89b0ce 100644
--- a/src/declarative/util/qmlanimation.cpp
+++ b/src/declarative/util/qmlanimation.cpp
@@ -762,46 +762,46 @@ void QmlColorAnimation::setTo(const QColor &t)
QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,ColorAnimation,QmlColorAnimation)
/*!
- \qmlclass RunScriptAction QmlRunScriptAction
+ \qmlclass ScriptAction QmlScriptAction
\inherits Animation
- \brief The RunScripAction allows scripts to be run during an animation.
+ \brief The ScriptAction allows scripts to be run during an animation.
*/
/*!
\internal
- \class QmlRunScriptAction
+ \class QmlScriptAction
*/
-QmlRunScriptAction::QmlRunScriptAction(QObject *parent)
- :QmlAbstractAnimation(*(new QmlRunScriptActionPrivate), parent)
+QmlScriptAction::QmlScriptAction(QObject *parent)
+ :QmlAbstractAnimation(*(new QmlScriptActionPrivate), parent)
{
- Q_D(QmlRunScriptAction);
+ Q_D(QmlScriptAction);
d->init();
}
-QmlRunScriptAction::~QmlRunScriptAction()
+QmlScriptAction::~QmlScriptAction()
{
}
-void QmlRunScriptActionPrivate::init()
+void QmlScriptActionPrivate::init()
{
- Q_Q(QmlRunScriptAction);
+ Q_Q(QmlScriptAction);
rsa = new QActionAnimation(&proxy);
QFx_setParent_noEvent(rsa, q);
}
/*!
- \qmlproperty QString RunScriptAction::script
+ \qmlproperty QString ScriptAction::script
This property holds the script to run.
*/
-QString QmlRunScriptAction::script() const
+QString QmlScriptAction::script() const
{
- Q_D(const QmlRunScriptAction);
+ Q_D(const QmlScriptAction);
return d->script;
}
-void QmlRunScriptAction::setScript(const QString &script)
+void QmlScriptAction::setScript(const QString &script)
{
- Q_D(QmlRunScriptAction);
+ Q_D(QmlScriptAction);
if (script == d->script)
return;
d->script = script;
@@ -809,27 +809,27 @@ void QmlRunScriptAction::setScript(const QString &script)
}
/*!
- \qmlproperty QString RunScriptAction::runScriptName
- This property holds the the name of the RunScript to run.
+ \qmlproperty QString ScriptAction::runScriptName
+ This property holds the the name of the StateChangeScript to run.
- This property is only valid when RunScriptAction is used as part of a transition.
+ This property is only valid when ScriptAction is used as part of a transition.
If both script and runScriptName are set, runScriptName will be used.
*/
-QString QmlRunScriptAction::runScriptName() const
+QString QmlScriptAction::runScriptName() const
{
- Q_D(const QmlRunScriptAction);
+ Q_D(const QmlScriptAction);
return d->script;
}
-void QmlRunScriptAction::setRunScriptName(const QString &name)
+void QmlScriptAction::setRunScriptName(const QString &name)
{
- Q_D(QmlRunScriptAction);
+ Q_D(QmlScriptAction);
d->name = name;
}
-void QmlRunScriptActionPrivate::execute()
+void QmlScriptActionPrivate::execute()
{
- Q_Q(QmlRunScriptAction);
+ Q_Q(QmlScriptAction);
QString scriptStr = runScriptScript.isEmpty() ? script : runScriptScript;
if (!scriptStr.isEmpty()) {
@@ -839,11 +839,11 @@ void QmlRunScriptActionPrivate::execute()
}
}
-void QmlRunScriptAction::transition(QmlStateActions &actions,
+void QmlScriptAction::transition(QmlStateActions &actions,
QmlMetaProperties &modified,
TransitionDirection direction)
{
- Q_D(QmlRunScriptAction);
+ Q_D(QmlScriptAction);
Q_UNUSED(modified);
Q_UNUSED(direction);
@@ -861,13 +861,13 @@ void QmlRunScriptAction::transition(QmlStateActions &actions,
}
}
-QAbstractAnimation *QmlRunScriptAction::qtAnimation()
+QAbstractAnimation *QmlScriptAction::qtAnimation()
{
- Q_D(QmlRunScriptAction);
+ Q_D(QmlScriptAction);
return d->rsa;
}
-QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,RunScriptAction,QmlRunScriptAction)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,ScriptAction,QmlScriptAction)
/*!
\qmlclass SetPropertyAction QmlSetPropertyAction
@@ -1075,56 +1075,56 @@ void QmlSetPropertyAction::transition(QmlStateActions &actions,
QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,SetPropertyAction,QmlSetPropertyAction)
/*!
- \qmlclass ParentChangeAction QmlParentChangeAction
+ \qmlclass ParentAction QmlParentAction
\inherits Animation
- \brief The ParentChangeAction allows parent changes during transitions.
+ \brief The ParentAction allows parent changes during transitions.
- The ParentChangeAction is immediate - it is not animated in any way.
+ The ParentAction is immediate - it is not animated in any way.
*/
-QmlParentChangeAction::QmlParentChangeAction(QObject *parent)
-: QmlAbstractAnimation(*(new QmlParentChangeActionPrivate), parent)
+QmlParentAction::QmlParentAction(QObject *parent)
+: QmlAbstractAnimation(*(new QmlParentActionPrivate), parent)
{
- Q_D(QmlParentChangeAction);
+ Q_D(QmlParentAction);
d->init();
}
-QmlParentChangeAction::~QmlParentChangeAction()
+QmlParentAction::~QmlParentAction()
{
}
-void QmlParentChangeActionPrivate::init()
+void QmlParentActionPrivate::init()
{
- Q_Q(QmlParentChangeAction);
+ Q_Q(QmlParentAction);
cpa = new QActionAnimation;
QFx_setParent_noEvent(cpa, q);
}
-QFxItem *QmlParentChangeAction::object() const
+QFxItem *QmlParentAction::object() const
{
- Q_D(const QmlParentChangeAction);
+ Q_D(const QmlParentAction);
return d->pcTarget;
}
-void QmlParentChangeAction::setObject(QFxItem *target)
+void QmlParentAction::setObject(QFxItem *target)
{
- Q_D(QmlParentChangeAction);
+ Q_D(QmlParentAction);
d->pcTarget = target;
}
-QFxItem *QmlParentChangeAction::parent() const
+QFxItem *QmlParentAction::parent() const
{
- Q_D(const QmlParentChangeAction);
+ Q_D(const QmlParentAction);
return d->pcParent;
}
-void QmlParentChangeAction::setParent(QFxItem *parent)
+void QmlParentAction::setParent(QFxItem *parent)
{
- Q_D(QmlParentChangeAction);
+ Q_D(QmlParentAction);
d->pcParent = parent;
}
-void QmlParentChangeActionPrivate::doAction()
+void QmlParentActionPrivate::doAction()
{
QmlParentChange pc;
pc.setObject(pcTarget);
@@ -1132,24 +1132,24 @@ void QmlParentChangeActionPrivate::doAction()
pc.execute();
}
-QAbstractAnimation *QmlParentChangeAction::qtAnimation()
+QAbstractAnimation *QmlParentAction::qtAnimation()
{
- Q_D(QmlParentChangeAction);
+ Q_D(QmlParentAction);
return d->cpa;
}
-void QmlParentChangeAction::transition(QmlStateActions &actions,
+void QmlParentAction::transition(QmlStateActions &actions,
QmlMetaProperties &modified,
TransitionDirection direction)
{
- Q_D(QmlParentChangeAction);
+ Q_D(QmlParentAction);
Q_UNUSED(modified);
Q_UNUSED(direction);
- struct QmlParentChangeActionData : public QAbstractAnimationAction
+ struct QmlParentActionData : public QAbstractAnimationAction
{
- QmlParentChangeActionData(): pc(0) {}
- ~QmlParentChangeActionData() { delete pc; }
+ QmlParentActionData(): pc(0) {}
+ ~QmlParentActionData() { delete pc; }
QmlStateActions actions;
bool reverse;
@@ -1166,7 +1166,7 @@ void QmlParentChangeAction::transition(QmlStateActions &actions,
}
};
- QmlParentChangeActionData *data = new QmlParentChangeActionData;
+ QmlParentActionData *data = new QmlParentActionData;
for (int ii = 0; ii < actions.count(); ++ii) {
Action &action = actions[ii];
@@ -1197,7 +1197,7 @@ void QmlParentChangeAction::transition(QmlStateActions &actions,
}
}
-QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,ParentChangeAction,QmlParentChangeAction)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,ParentAction,QmlParentAction)
/*!
\qmlclass NumberAnimation QmlNumberAnimation
diff --git a/src/declarative/util/qmlanimation.h b/src/declarative/util/qmlanimation.h
index 602bf37..e27c899 100644
--- a/src/declarative/util/qmlanimation.h
+++ b/src/declarative/util/qmlanimation.h
@@ -157,18 +157,18 @@ protected:
virtual QAbstractAnimation *qtAnimation();
};
-class QmlRunScriptActionPrivate;
-class QmlRunScriptAction : public QmlAbstractAnimation
+class QmlScriptActionPrivate;
+class QmlScriptAction : public QmlAbstractAnimation
{
Q_OBJECT
- Q_DECLARE_PRIVATE(QmlRunScriptAction)
+ Q_DECLARE_PRIVATE(QmlScriptAction)
Q_PROPERTY(QString script READ script WRITE setScript NOTIFY scriptChanged)
Q_PROPERTY(QString runScriptName READ runScriptName WRITE setRunScriptName)
public:
- QmlRunScriptAction(QObject *parent=0);
- virtual ~QmlRunScriptAction();
+ QmlScriptAction(QObject *parent=0);
+ virtual ~QmlScriptAction();
QString script() const;
void setScript(const QString &);
@@ -225,18 +225,18 @@ protected:
};
class QFxItem;
-class QmlParentChangeActionPrivate;
-class QmlParentChangeAction : public QmlAbstractAnimation
+class QmlParentActionPrivate;
+class QmlParentAction : public QmlAbstractAnimation
{
Q_OBJECT
- Q_DECLARE_PRIVATE(QmlParentChangeAction)
+ Q_DECLARE_PRIVATE(QmlParentAction)
Q_PROPERTY(QFxItem *target READ object WRITE setObject)
Q_PROPERTY(QFxItem *parent READ parent WRITE setParent)
public:
- QmlParentChangeAction(QObject *parent=0);
- virtual ~QmlParentChangeAction();
+ QmlParentAction(QObject *parent=0);
+ virtual ~QmlParentAction();
QFxItem *object() const;
void setObject(QFxItem *);
@@ -395,9 +395,9 @@ QT_END_NAMESPACE
QML_DECLARE_TYPE(QmlAbstractAnimation)
QML_DECLARE_TYPE(QmlPauseAnimation)
-QML_DECLARE_TYPE(QmlRunScriptAction)
+QML_DECLARE_TYPE(QmlScriptAction)
QML_DECLARE_TYPE(QmlSetPropertyAction)
-QML_DECLARE_TYPE(QmlParentChangeAction)
+QML_DECLARE_TYPE(QmlParentAction)
QML_DECLARE_TYPE(QmlPropertyAnimation)
QML_DECLARE_TYPE(QmlColorAnimation)
QML_DECLARE_TYPE(QmlNumberAnimation)
diff --git a/src/declarative/util/qmlanimation_p.h b/src/declarative/util/qmlanimation_p.h
index fb4dae0..b81f5ae 100644
--- a/src/declarative/util/qmlanimation_p.h
+++ b/src/declarative/util/qmlanimation_p.h
@@ -220,11 +220,11 @@ public:
QPauseAnimation *pa;
};
-class QmlRunScriptActionPrivate : public QmlAbstractAnimationPrivate
+class QmlScriptActionPrivate : public QmlAbstractAnimationPrivate
{
- Q_DECLARE_PUBLIC(QmlRunScriptAction)
+ Q_DECLARE_PUBLIC(QmlScriptAction)
public:
- QmlRunScriptActionPrivate()
+ QmlScriptActionPrivate()
: QmlAbstractAnimationPrivate(), proxy(this), rsa(0) {}
void init();
@@ -235,8 +235,8 @@ public:
void execute();
- QAnimationActionProxy<QmlRunScriptActionPrivate,
- &QmlRunScriptActionPrivate::execute> proxy;
+ QAnimationActionProxy<QmlScriptActionPrivate,
+ &QmlScriptActionPrivate::execute> proxy;
QActionAnimation *rsa;
};
@@ -262,11 +262,11 @@ public:
QActionAnimation *spa;
};
-class QmlParentChangeActionPrivate : public QmlAbstractAnimationPrivate
+class QmlParentActionPrivate : public QmlAbstractAnimationPrivate
{
- Q_DECLARE_PUBLIC(QmlParentChangeAction)
+ Q_DECLARE_PUBLIC(QmlParentAction)
public:
- QmlParentChangeActionPrivate()
+ QmlParentActionPrivate()
: QmlAbstractAnimationPrivate(), pcTarget(0), pcParent(0) {}
void init();