diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2009-08-18 05:17:25 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2009-08-18 05:17:25 (GMT) |
commit | 0a74f871b21a9b7835fb1a5213bcac22ca1592cc (patch) | |
tree | b95a8ff0a652e493346656b42e5ad74797c195e4 | |
parent | ccd11ebe69f0f7088d2b1de2c372326a4f543827 (diff) | |
download | Qt-0a74f871b21a9b7835fb1a5213bcac22ca1592cc.zip Qt-0a74f871b21a9b7835fb1a5213bcac22ca1592cc.tar.gz Qt-0a74f871b21a9b7835fb1a5213bcac22ca1592cc.tar.bz2 |
Rename filter to targets.
-rw-r--r-- | demos/declarative/flickr/flickr.qml | 2 | ||||
-rw-r--r-- | demos/declarative/flickr/flickr2.qml | 2 | ||||
-rw-r--r-- | examples/declarative/flowview/flowview.qml | 4 | ||||
-rw-r--r-- | src/declarative/util/qmlanimation.cpp | 45 | ||||
-rw-r--r-- | src/declarative/util/qmlanimation.h | 13 | ||||
-rw-r--r-- | src/declarative/util/qmlanimation_p.h | 5 |
6 files changed, 20 insertions, 51 deletions
diff --git a/demos/declarative/flickr/flickr.qml b/demos/declarative/flickr/flickr.qml index a8d18fb..af2fda4 100644 --- a/demos/declarative/flickr/flickr.qml +++ b/demos/declarative/flickr/flickr.qml @@ -109,7 +109,7 @@ Item { SequentialAnimation { ParentChangeAction { } NumberAnimation { properties: "x,y,scale,opacity,angle"; duration: 500; easing: "easeInOutQuad" } - SetPropertyAction { filter: Wrapper; properties: "z" } + SetPropertyAction { target: Wrapper; properties: "z" } } } ] diff --git a/demos/declarative/flickr/flickr2.qml b/demos/declarative/flickr/flickr2.qml index 5350a36..569f286 100644 --- a/demos/declarative/flickr/flickr2.qml +++ b/demos/declarative/flickr/flickr2.qml @@ -108,7 +108,7 @@ Item { SequentialAnimation { ParentChangeAction { } NumberAnimation { properties: "x,y,scale,opacity,angle"; duration: 500; easing: "easeInOutQuad" } - SetPropertyAction { filter: Wrapper; properties: "z" } + SetPropertyAction { target: Wrapper; properties: "z" } } } ] diff --git a/examples/declarative/flowview/flowview.qml b/examples/declarative/flowview/flowview.qml index a3d0ac5..8d1bdf6 100644 --- a/examples/declarative/flowview/flowview.qml +++ b/examples/declarative/flowview/flowview.qml @@ -25,8 +25,8 @@ Rect { fromState: "" ; toState: "rotated" reversible: true SequentialAnimation { - NumberAnimation { filter: [TopBar, BottomBar]; properties: "x,y"; easing: "easeInOutQuad" } - NumberAnimation { filter: [LeftBar, RightBar]; properties: "x,y"; easing: "easeInOutQuad"} + NumberAnimation { targets: [TopBar, BottomBar]; properties: "x,y"; easing: "easeInOutQuad" } + NumberAnimation { targets: [LeftBar, RightBar]; properties: "x,y"; easing: "easeInOutQuad"} } } diff --git a/src/declarative/util/qmlanimation.cpp b/src/declarative/util/qmlanimation.cpp index 224f668..ee16fae 100644 --- a/src/declarative/util/qmlanimation.cpp +++ b/src/declarative/util/qmlanimation.cpp @@ -823,35 +823,10 @@ void QmlRunScriptAction::setScript(const QString &script) emit scriptChanged(script); } -/*! - \qmlproperty QString RunScript::script - This property holds the file containing the script to run. -*/ -QString QmlRunScriptAction::file() const -{ - Q_D(const QmlRunScriptAction); - return d->file; -} - -void QmlRunScriptAction::setFile(const QString &file) -{ - Q_D(QmlRunScriptAction); - if (file == d->file) - return; - d->file = file; - emit fileChanged(file); -} - void QmlRunScriptActionPrivate::execute() { Q_Q(QmlRunScriptAction); QString scriptStr = script; - if (!file.isEmpty()){ - QFile scriptFile(file); - if (scriptFile.open(QIODevice::ReadOnly | QIODevice::Text)){ - scriptStr = QString::fromUtf8(scriptFile.readAll()); - } - } if (!scriptStr.isEmpty()) { QmlExpression expr(qmlContext(q), scriptStr, q); @@ -932,20 +907,20 @@ void QmlSetPropertyAction::setProperties(const QString &p) } /*! - \qmlproperty list<Item> SetPropertyAction::filter + \qmlproperty list<Item> SetPropertyAction::targets This property holds the items selected to be affected by this animation (all if not set). \sa exclude */ -QList<QObject *> *QmlSetPropertyAction::filter() +QList<QObject *> *QmlSetPropertyAction::targets() { Q_D(QmlSetPropertyAction); - return &d->filter; + return &d->targets; } /*! \qmlproperty list<Item> SetPropertyAction::exclude This property holds the items not to be affected by this animation. - \sa filter + \sa targets */ QList<QObject *> *QmlSetPropertyAction::exclude() { @@ -1040,7 +1015,7 @@ void QmlSetPropertyAction::transition(QmlStateActions &actions, QString sPropertyName = action.specifiedProperty; bool same = (obj == sObj); - if ((d->filter.isEmpty() || d->filter.contains(obj) || (!same && d->filter.contains(sObj))) && + if ((d->targets.isEmpty() || d->targets.contains(obj) || (!same && d->targets.contains(sObj))) && (!d->exclude.contains(obj)) && (same || (!d->exclude.contains(sObj))) && (props.contains(propertyName) || (!same && props.contains(sPropertyName))) && (!target() || target() == obj || (!same && target() == sObj))) { @@ -1692,20 +1667,20 @@ void QmlPropertyAnimation::setProperties(const QString &prop) } /*! - \qmlproperty list<Item> PropertyAnimation::filter + \qmlproperty list<Item> PropertyAnimation::targets This property holds the items selected to be affected by this animation (all if not set). \sa exclude */ -QList<QObject *> *QmlPropertyAnimation::filter() +QList<QObject *> *QmlPropertyAnimation::targets() { Q_D(QmlPropertyAnimation); - return &d->filter; + return &d->targets; } /*! \qmlproperty list<Item> PropertyAnimation::exclude This property holds the items not to be affected by this animation. - \sa filter + \sa targets */ QList<QObject *> *QmlPropertyAnimation::exclude() { @@ -1836,7 +1811,7 @@ void QmlPropertyAnimation::transition(QmlStateActions &actions, QString sPropertyName = action.specifiedProperty; bool same = (obj == sObj); - if ((d->filter.isEmpty() || d->filter.contains(obj) || (!same && d->filter.contains(sObj))) && + if ((d->targets.isEmpty() || d->targets.contains(obj) || (!same && d->targets.contains(sObj))) && (!d->exclude.contains(obj)) && (same || (!d->exclude.contains(sObj))) && (props.contains(propertyName) || (!same && props.contains(sPropertyName)) || (useType && action.property.propertyType() == d->interpolatorType)) && diff --git a/src/declarative/util/qmlanimation.h b/src/declarative/util/qmlanimation.h index 91c1898..ef7842c 100644 --- a/src/declarative/util/qmlanimation.h +++ b/src/declarative/util/qmlanimation.h @@ -163,7 +163,6 @@ class QmlRunScriptAction : public QmlAbstractAnimation Q_DECLARE_PRIVATE(QmlRunScriptAction) Q_PROPERTY(QString script READ script WRITE setScript NOTIFY scriptChanged) - Q_PROPERTY(QString file READ file WRITE setFile NOTIFY fileChanged) public: QmlRunScriptAction(QObject *parent=0); @@ -172,11 +171,7 @@ public: QString script() const; void setScript(const QString &); - QString file() const; - void setFile(const QString &); - Q_SIGNALS: - void fileChanged(const QString &); void scriptChanged(const QString &); protected: @@ -190,7 +185,7 @@ class QmlSetPropertyAction : public QmlAbstractAnimation Q_DECLARE_PRIVATE(QmlSetPropertyAction) Q_PROPERTY(QString properties READ properties WRITE setProperties NOTIFY propertiesChanged) - Q_PROPERTY(QList<QObject *>* filter READ filter) + Q_PROPERTY(QList<QObject *>* targets READ targets) Q_PROPERTY(QList<QObject *>* exclude READ exclude) Q_PROPERTY(QVariant value READ value WRITE setValue NOTIFY valueChanged) @@ -201,7 +196,7 @@ public: QString properties() const; void setProperties(const QString &); - QList<QObject *> *filter(); + QList<QObject *> *targets(); QList<QObject *> *exclude(); QVariant value() const; @@ -250,7 +245,7 @@ class QmlPropertyAnimation : public QmlAbstractAnimation Q_PROPERTY(QVariant to READ to WRITE setTo NOTIFY toChanged) Q_PROPERTY(QString easing READ easing WRITE setEasing NOTIFY easingChanged) Q_PROPERTY(QString properties READ properties WRITE setProperties NOTIFY propertiesChanged) - Q_PROPERTY(QList<QObject *>* filter READ filter) + Q_PROPERTY(QList<QObject *>* targets READ targets) Q_PROPERTY(QList<QObject *>* exclude READ exclude) public: @@ -272,7 +267,7 @@ public: QString properties() const; void setProperties(const QString &); - QList<QObject *> *filter(); + QList<QObject *> *targets(); QList<QObject *> *exclude(); protected: diff --git a/src/declarative/util/qmlanimation_p.h b/src/declarative/util/qmlanimation_p.h index 87d480f..3868255 100644 --- a/src/declarative/util/qmlanimation_p.h +++ b/src/declarative/util/qmlanimation_p.h @@ -230,7 +230,6 @@ public: void init(); QString script; - QString file; void execute(); @@ -249,7 +248,7 @@ public: void init(); QString properties; - QList<QObject *> filter; + QList<QObject *> targets; QList<QObject *> exclude; QmlNullableValue<QVariant> value; @@ -330,7 +329,7 @@ public: QString easing; QString properties; - QList<QObject *> filter; + QList<QObject *> targets; QList<QObject *> exclude; bool fromSourced; |