Skip to content

Commit

Permalink
Remove binding dependency on QQmlExpression
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Aaron Kennedy authored and Qt by Nokia committed Mar 15, 2012
1 parent b061083 commit 5ae8cab
Show file tree
Hide file tree
Showing 25 changed files with 400 additions and 470 deletions.
4 changes: 1 addition & 3 deletions src/qml/debugger/qqmlenginedebugservice.cpp
Expand Up @@ -577,10 +577,8 @@ void QQmlEngineDebugService::setBinding(int objectId,
QQmlPropertyPrivate::setSignalExpression(property, qmlExpression);
qmlExpression->setSourceLocation(filename, line, column);
} else if (property.isProperty()) {
QQmlBinding *binding = new QQmlBinding(expression.toString(), object, context);
QQmlBinding *binding = new QQmlBinding(expression.toString(), false, object, QQmlContextData::get(context), filename, line, column);;
binding->setTarget(property);
binding->setSourceLocation(filename, line, column);
binding->setNotifyOnValueChanged(true);
QQmlAbstractBinding *oldBinding = QQmlPropertyPrivate::setBinding(property, binding);
if (oldBinding)
oldBinding->destroy();
Expand Down
1 change: 0 additions & 1 deletion src/qml/qml/qml.pri
Expand Up @@ -64,7 +64,6 @@ HEADERS += \
$$PWD/qqml.h \
$$PWD/qquickapplication_p.h \
$$PWD/qqmlbinding_p.h \
$$PWD/qqmlbinding_p_p.h \
$$PWD/qqmlproperty.h \
$$PWD/qqmlcomponent.h \
$$PWD/qqmlcomponent_p.h \
Expand Down
7 changes: 7 additions & 0 deletions src/qml/qml/qqmlabstractbinding.cpp
Expand Up @@ -41,6 +41,7 @@

#include "qqmlabstractbinding_p.h"

#include <QtQml/qqmlinfo.h>
#include <private/qqmlbinding_p.h>
#include <private/qqmlvaluetypeproxybinding_p.h>

Expand Down Expand Up @@ -154,6 +155,12 @@ void QQmlAbstractBinding::removeFromObject()
}
}

void QQmlAbstractBinding::printBindingLoopError(QQmlProperty &prop)
{
qmlInfo(prop.object()) << QString(QLatin1String("Binding loop detected for property \"%1\"")).arg(prop.name());
}


static void bindingDummyDeleter(QQmlAbstractBinding *)
{
}
Expand Down
1 change: 1 addition & 0 deletions src/qml/qml/qqmlabstractbinding_p.h
Expand Up @@ -92,6 +92,7 @@ class Q_QML_PRIVATE_EXPORT QQmlAbstractBinding
void removeFromObject();

static inline Pointer getPointer(QQmlAbstractBinding *p);
static void printBindingLoopError(QQmlProperty &prop);

protected:
virtual ~QQmlAbstractBinding();
Expand Down

0 comments on commit 5ae8cab

Please sign in to comment.