aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2012-03-09 09:16:50 +0100
committerQt by Nokia <qt-info@nokia.com>2012-03-15 01:33:24 +0100
commit5ae8caba10a79c2298939aff777a0201959a94af (patch)
tree2477ed24cb6d0c0309f662f1a63d26b4619df4ce /src/quick
parentb06108350b1390b51886474628e03e2e84640548 (diff)
Remove binding dependency on QQmlExpression
This is the first step to creating much lighter weight bindings that are tuned for the specific scenario in which they're used. Change-Id: Ib985dcff25679b711b5c634bbc891aa7902bf405 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Diffstat (limited to 'src/quick')
-rw-r--r--src/quick/items/qquickstateoperations.cpp12
-rw-r--r--src/quick/qtquick2.cpp5
-rw-r--r--src/quick/util/qquickpropertychanges.cpp11
3 files changed, 14 insertions, 14 deletions
diff --git a/src/quick/items/qquickstateoperations.cpp b/src/quick/items/qquickstateoperations.cpp
index 668c7c07d7..a6a4e31aba 100644
--- a/src/quick/items/qquickstateoperations.cpp
+++ b/src/quick/items/qquickstateoperations.cpp
@@ -318,7 +318,7 @@ QQuickStateOperation::ActionList QQuickParentChange::actions()
newBinding->setTarget(property);
QQuickAction xa;
xa.property = property;
- xa.toBinding = newBinding;
+ xa.toBinding = QQmlAbstractBinding::getPointer(newBinding);
xa.fromValue = xa.property.read();
xa.deletableToBinding = true;
actions << xa;
@@ -338,7 +338,7 @@ QQuickStateOperation::ActionList QQuickParentChange::actions()
newBinding->setTarget(property);
QQuickAction ya;
ya.property = property;
- ya.toBinding = newBinding;
+ ya.toBinding = QQmlAbstractBinding::getPointer(newBinding);
ya.fromValue = ya.property.read();
ya.deletableToBinding = true;
actions << ya;
@@ -358,7 +358,7 @@ QQuickStateOperation::ActionList QQuickParentChange::actions()
newBinding->setTarget(property);
QQuickAction sa;
sa.property = property;
- sa.toBinding = newBinding;
+ sa.toBinding = QQmlAbstractBinding::getPointer(newBinding);
sa.fromValue = sa.property.read();
sa.deletableToBinding = true;
actions << sa;
@@ -378,7 +378,7 @@ QQuickStateOperation::ActionList QQuickParentChange::actions()
newBinding->setTarget(property);
QQuickAction ra;
ra.property = property;
- ra.toBinding = newBinding;
+ ra.toBinding = QQmlAbstractBinding::getPointer(newBinding);
ra.fromValue = ra.property.read();
ra.deletableToBinding = true;
actions << ra;
@@ -398,7 +398,7 @@ QQuickStateOperation::ActionList QQuickParentChange::actions()
newBinding->setTarget(property);
QQuickAction wa;
wa.property = property;
- wa.toBinding = newBinding;
+ wa.toBinding = QQmlAbstractBinding::getPointer(newBinding);
wa.fromValue = wa.property.read();
wa.deletableToBinding = true;
actions << wa;
@@ -418,7 +418,7 @@ QQuickStateOperation::ActionList QQuickParentChange::actions()
newBinding->setTarget(property);
QQuickAction ha;
ha.property = property;
- ha.toBinding = newBinding;
+ ha.toBinding = QQmlAbstractBinding::getPointer(newBinding);
ha.fromValue = ha.property.read();
ha.deletableToBinding = true;
actions << ha;
diff --git a/src/quick/qtquick2.cpp b/src/quick/qtquick2.cpp
index 621c3ff18e..32a9d382f2 100644
--- a/src/quick/qtquick2.cpp
+++ b/src/quick/qtquick2.cpp
@@ -135,10 +135,11 @@ void QQmlQtQuick2DebugStatesDelegate::updateBinding(QQmlContext *context,
QQmlBinding *newBinding = 0;
if (!isLiteralValue) {
- newBinding = new QQmlBinding(expression.toString(), object, context);
+ newBinding = new QQmlBinding(expression.toString(), false, object,
+ QQmlContextData::get(context), fileName,
+ line, column);
newBinding->setTarget(property);
newBinding->setNotifyOnValueChanged(true);
- newBinding->setSourceLocation(fileName, line, column);
}
state->changeBindingInRevertList(object, propertyName, newBinding);
diff --git a/src/quick/util/qquickpropertychanges.cpp b/src/quick/util/qquickpropertychanges.cpp
index 83ddb2530e..8b0818c96c 100644
--- a/src/quick/util/qquickpropertychanges.cpp
+++ b/src/quick/util/qquickpropertychanges.cpp
@@ -478,12 +478,11 @@ QQuickPropertyChanges::ActionList QQuickPropertyChanges::actions()
QQmlBinding::Identifier id = d->expressions.at(ii).id;
QQmlBinding *newBinding = id != QQmlBinding::Invalid ? QQmlBinding::createBinding(id, object(), qmlContext(this), e->sourceFile(), e->lineNumber()) : 0;
- if (!newBinding) {
- newBinding = new QQmlBinding(e->expression(), object(), qmlContext(this));
- newBinding->setSourceLocation(e->sourceFile(), e->lineNumber(), e->columnNumber());
- }
+ if (!newBinding)
+ newBinding = new QQmlBinding(e->expression(), false, object(), QQmlContextData::get(qmlContext(this)),
+ e->sourceFile(), e->lineNumber(), e->columnNumber());
newBinding->setTarget(prop);
- a.toBinding = newBinding;
+ a.toBinding = QQmlAbstractBinding::getPointer(newBinding);
a.deletableToBinding = true;
}
@@ -682,7 +681,7 @@ void QQuickPropertyChanges::changeExpression(const QString &name, const QString
} else {
QQmlBinding *newBinding = new QQmlBinding(newExpression->expression(), object(), qmlContext(this));
newBinding->setTarget(d->property(name));
- action.toBinding = newBinding;
+ action.toBinding = QQmlAbstractBinding::getPointer(newBinding);
action.deletableToBinding = true;
state()->addEntryToRevertList(action);