diff options
author | Chris Adams <christopher.adams@nokia.com> | 2012-03-27 16:56:08 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-29 00:40:48 +0200 |
commit | 53d5deb5034bf5adb8719723bc66eb3a61638a32 (patch) | |
tree | 011c99abcadf6c4ef723586e25c8f56cd6f3b113 /src/qml/qml/qqmlproperty.cpp | |
parent | e4baefacff3e04ea3b599c5279e883d75d2ad489 (diff) |
Use minimal javascript expression for bound signals
Previously, QQmlBoundSignal used QQmlExpression internally. This
commit adds a new, more optimal QQmlJavaScriptExpression subclass
specifically designed for QQmlBoundSignal, and converts the code
to use it instead of QQmlExpression where appropriate.
Task-number: QTBUG-24460
Change-Id: I2865a119ce840235e27a7722d8052ca61c265f69
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Diffstat (limited to 'src/qml/qml/qqmlproperty.cpp')
-rw-r--r-- | src/qml/qml/qqmlproperty.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/qml/qml/qqmlproperty.cpp b/src/qml/qml/qqmlproperty.cpp index b798215fa5..1b01a7d7c1 100644 --- a/src/qml/qml/qqmlproperty.cpp +++ b/src/qml/qml/qqmlproperty.cpp @@ -920,7 +920,7 @@ QQmlPropertyPrivate::setBindingNoEnable(QObject *object, int coreIndex, int valu Returns the expression associated with this signal property, or 0 if no signal expression exists. */ -QQmlExpression * +QQmlBoundSignalExpression * QQmlPropertyPrivate::signalExpression(const QQmlProperty &that) { if (!(that.type() & QQmlProperty::SignalProperty)) @@ -948,9 +948,9 @@ QQmlPropertyPrivate::signalExpression(const QQmlProperty &that) Ownership of \a expr transfers to QML. Ownership of the return value is assumed by the caller. */ -QQmlExpression * +QQmlBoundSignalExpression * QQmlPropertyPrivate::setSignalExpression(const QQmlProperty &that, - QQmlExpression *expr) + QQmlBoundSignalExpression *expr) { if (!(that.type() & QQmlProperty::SignalProperty)) { delete expr; @@ -975,7 +975,7 @@ QQmlPropertyPrivate::setSignalExpression(const QQmlProperty &that, signal = new QQmlBoundSignal(that.d->object, that.method(), that.d->object); else signal = new QQmlBoundSignalNoParams(that.d->object, that.method(), that.d->object); - QQmlExpression *oldExpr = signal->setExpression(expr); + QQmlBoundSignalExpression *oldExpr = signal->setExpression(expr); signal->addToObject(); return oldExpr; } else { |