aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlbinding.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/qml/qqmlbinding.cpp')
-rw-r--r--src/qml/qml/qqmlbinding.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlbinding.cpp b/src/qml/qml/qqmlbinding.cpp
index a8232904fe..aabdf00f6e 100644
--- a/src/qml/qml/qqmlbinding.cpp
+++ b/src/qml/qml/qqmlbinding.cpp
@@ -123,6 +123,21 @@ QQmlBinding *QQmlBinding::create(const QQmlPropertyData *property, const QV4::Fu
return b;
}
+QQmlBinding *QQmlBinding::create(const QQmlPropertyData *property, QV4::Function *function,
+ QObject *obj, QQmlContextData *ctxt, QV4::QmlContext *sharedContext)
+{
+ QQmlBinding *b = newBinding(QQmlEnginePrivate::get(ctxt), property);
+
+ b->setNotifyOnValueChanged(true);
+ b->QQmlJavaScriptExpression::setContext(ctxt);
+ b->setScopeObject(obj);
+
+ Q_ASSERT(sharedContext);
+ b->setupFunction(sharedContext, function);
+
+ return b;
+}
+
QQmlBinding::~QQmlBinding()
{
}