summaryrefslogtreecommitdiffstats
path: root/src/declarative/util
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2009-10-12 00:33:01 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2009-10-12 00:33:01 (GMT)
commite508e614ccb4406ce43abb2c230c9d9ac976a573 (patch)
tree6fadedce2c08561185e6d846e83416fe22d8c72c /src/declarative/util
parent86cd2fa6836c90ed329eb1f0507eeb311810c194 (diff)
parenteca4d3662d61aea60478772d8cfa477642d284df (diff)
downloadQt-e508e614ccb4406ce43abb2c230c9d9ac976a573.zip
Qt-e508e614ccb4406ce43abb2c230c9d9ac976a573.tar.gz
Qt-e508e614ccb4406ce43abb2c230c9d9ac976a573.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'src/declarative/util')
-rw-r--r--src/declarative/util/qmlanimation.cpp24
-rw-r--r--src/declarative/util/qmlpropertychanges.cpp19
-rw-r--r--src/declarative/util/qmlstate.cpp4
-rw-r--r--src/declarative/util/qmltransitionmanager.cpp11
4 files changed, 30 insertions, 28 deletions
diff --git a/src/declarative/util/qmlanimation.cpp b/src/declarative/util/qmlanimation.cpp
index 3edbc5f..247e64c 100644
--- a/src/declarative/util/qmlanimation.cpp
+++ b/src/declarative/util/qmlanimation.cpp
@@ -972,7 +972,7 @@ void QmlPropertyAction::setValue(const QVariant &v)
void QmlPropertyActionPrivate::doAction()
{
- property.write(value);
+ property.write(value, QmlMetaProperty::BypassInterceptor | QmlMetaProperty::DontRemoveBinding);
}
QAbstractAnimation *QmlPropertyAction::qtAnimation()
@@ -1007,9 +1007,7 @@ void QmlPropertyAction::transition(QmlStateActions &actions,
{
for (int ii = 0; ii < actions.count(); ++ii) {
const Action &action = actions.at(ii);
- QmlBehavior::_ignore = true;
- action.property.write(action.toValue);
- QmlBehavior::_ignore = false;
+ action.property.write(action.toValue, QmlMetaProperty::BypassInterceptor | QmlMetaProperty::DontRemoveBinding);
}
}
};
@@ -1020,9 +1018,11 @@ void QmlPropertyAction::transition(QmlStateActions &actions,
if (!d->propertyName.isEmpty() && !props.contains(d->propertyName))
props.append(d->propertyName);
+ bool targetNeedsReset = false;
if (d->userProperty.isValid() && props.isEmpty() && !target()) {
props.append(d->userProperty.value.name());
d->target = d->userProperty.value.object();
+ targetNeedsReset = true;
}
QmlSetPropertyAnimationAction *data = new QmlSetPropertyAnimationAction;
@@ -1070,6 +1070,8 @@ void QmlPropertyAction::transition(QmlStateActions &actions,
} else {
delete data;
}
+ if (targetNeedsReset)
+ d->target = 0;
}
QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,PropertyAction,QmlPropertyAction)
@@ -1714,10 +1716,10 @@ void QmlPropertyAnimationPrivate::valueChanged(qreal r)
}
if (r == 1.) {
- property.write(to);
+ property.write(to, QmlMetaProperty::BypassInterceptor | QmlMetaProperty::DontRemoveBinding);
} else {
if (interpolator)
- property.write(interpolator(from.constData(), to.constData(), r));
+ property.write(interpolator(from.constData(), to.constData(), r), QmlMetaProperty::BypassInterceptor | QmlMetaProperty::DontRemoveBinding);
}
}
@@ -1773,9 +1775,8 @@ void QmlPropertyAnimation::transition(QmlStateActions &actions,
for (int ii = 0; ii < actions.count(); ++ii) {
Action &action = actions[ii];
- QmlBehavior::_ignore = true;
if (v == 1.)
- action.property.write(action.toValue);
+ action.property.write(action.toValue, QmlMetaProperty::BypassInterceptor | QmlMetaProperty::DontRemoveBinding);
else {
if (action.fromValue.isNull()) {
action.fromValue = action.property.read();
@@ -1790,9 +1791,8 @@ void QmlPropertyAnimation::transition(QmlStateActions &actions,
}
}
if (interpolator)
- action.property.write(interpolator(action.fromValue.constData(), action.toValue.constData(), v));
+ action.property.write(interpolator(action.fromValue.constData(), action.toValue.constData(), v), QmlMetaProperty::BypassInterceptor | QmlMetaProperty::DontRemoveBinding);
}
- QmlBehavior::_ignore = false;
}
}
};
@@ -1805,9 +1805,11 @@ void QmlPropertyAnimation::transition(QmlStateActions &actions,
bool useType = (props.isEmpty() && d->defaultToInterpolatorType) ? true : false;
+ bool targetNeedsReset = false;
if (d->userProperty.isValid() && props.isEmpty() && !target()) {
props.append(d->userProperty.value.name());
d->target = d->userProperty.value.object();
+ targetNeedsReset = true;
}
PropertyUpdater *data = new PropertyUpdater;
@@ -1874,6 +1876,8 @@ void QmlPropertyAnimation::transition(QmlStateActions &actions,
} else {
delete data;
}
+ if (targetNeedsReset)
+ d->target = 0;
}
QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,PropertyAnimation,QmlPropertyAnimation)
diff --git a/src/declarative/util/qmlpropertychanges.cpp b/src/declarative/util/qmlpropertychanges.cpp
index a5a08bc..b07a79f 100644
--- a/src/declarative/util/qmlpropertychanges.cpp
+++ b/src/declarative/util/qmlpropertychanges.cpp
@@ -230,17 +230,18 @@ void QmlPropertyChangesPrivate::decode()
ds >> isScript;
ds >> data;
- if (isScript) {
- QmlMetaProperty prop = property(name); //### can we avoid or reuse?
+ QmlMetaProperty prop = property(name); //### better way to check for signal property?
+ if (prop.type() == QmlMetaProperty::SignalProperty) {
QmlExpression *expression = new QmlExpression(qmlContext(q), data.toString(), object);
expression->setTrackChange(false);
- if (prop.type() == QmlMetaProperty::SignalProperty) {
- QmlReplaceSignalHandler *handler = new QmlReplaceSignalHandler;
- handler->property = prop;
- handler->expression = expression;
- signalReplacements << handler;
- } else
- expressions << qMakePair(name, expression);
+ QmlReplaceSignalHandler *handler = new QmlReplaceSignalHandler;
+ handler->property = prop;
+ handler->expression = expression;
+ signalReplacements << handler;
+ } else if (isScript) {
+ QmlExpression *expression = new QmlExpression(qmlContext(q), data.toString(), object);
+ expression->setTrackChange(false);
+ expressions << qMakePair(name, expression);
} else {
properties << qMakePair(name, data);
}
diff --git a/src/declarative/util/qmlstate.cpp b/src/declarative/util/qmlstate.cpp
index 3c85db7..98facd9 100644
--- a/src/declarative/util/qmlstate.cpp
+++ b/src/declarative/util/qmlstate.cpp
@@ -350,6 +350,7 @@ void QmlState::apply(QmlStateGroup *group, QmlTransition *trans, QmlState *rever
if (action.event) {
if (!action.event->isReversable())
continue;
+ action.event->saveOriginals();
for (jj = 0; jj < d->revertList.count(); ++jj) {
ActionEvent *event = d->revertList.at(jj).event;
if (event && event->typeName() == action.event->typeName()) {
@@ -359,9 +360,6 @@ void QmlState::apply(QmlStateGroup *group, QmlTransition *trans, QmlState *rever
}
}
}
- if (!found)
- action.event->saveOriginals();
- //### do we ever need to do saveOriginals when found == true?
} else {
action.fromBinding = action.property.binding();
diff --git a/src/declarative/util/qmltransitionmanager.cpp b/src/declarative/util/qmltransitionmanager.cpp
index 3e2e05f..7eaccac 100644
--- a/src/declarative/util/qmltransitionmanager.cpp
+++ b/src/declarative/util/qmltransitionmanager.cpp
@@ -144,9 +144,9 @@ void QmlTransitionManager::transition(const QList<Action> &list,
for (int ii = 0; ii < applyList.size(); ++ii) {
const Action &action = applyList.at(ii);
if (action.toBinding) {
- action.property.setBinding(action.toBinding);
+ action.property.setBinding(action.toBinding, QmlMetaProperty::BypassInterceptor | QmlMetaProperty::DontRemoveBinding);
} else if (!action.event) {
- action.property.write(action.toValue);
+ action.property.write(action.toValue, QmlMetaProperty::BypassInterceptor | QmlMetaProperty::DontRemoveBinding);
} else if (action.event->isReversable()) {
if (action.reverseEvent)
action.event->reverse();
@@ -187,7 +187,7 @@ void QmlTransitionManager::transition(const QList<Action> &list,
if (action.toBinding)
action.property.setBinding(0); // Make sure this is disabled during the transition
- action.property.write(action.fromValue);
+ action.property.write(action.fromValue, QmlMetaProperty::BypassInterceptor | QmlMetaProperty::DontRemoveBinding);
}
}
@@ -223,7 +223,7 @@ void QmlTransitionManager::transition(const QList<Action> &list,
}
// Any actions remaining have not been handled by the transition and should
- // be applied immediately. We skip applying transitions, as they are all
+ // 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 Action &action, applyList) {
@@ -232,13 +232,12 @@ void QmlTransitionManager::transition(const QList<Action> &list,
action.event->reverse();
else
action.event->execute();
- } else if (!action.event) {
+ } else if (!action.event && !action.toBinding) {
action.property.write(action.toValue);
}
}
if (!transition)
d->applyBindings();
-
}
void QmlTransitionManager::cancel()