aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlvaluetypewrapper.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@theqtcompany.com>2014-11-14 16:12:14 +0100
committerSimon Hausmann <simon.hausmann@digia.com>2014-12-13 00:06:44 +0100
commita3d89b09b77c268f3c279f207c1df0aa1415dea9 (patch)
tree3a5cc421c9bf0c141afdc6863df2fc7f6c4cdfee /src/qml/qml/qqmlvaluetypewrapper.cpp
parente8b9f28cad6c73c6e3b2ac07d1de8f18b812fbe6 (diff)
Simplify calling methods on value types
We don't need to go deep through the QObject wrapper, we can use QObjectMethod directly after we've determined a Q_INVOKABLE property. Change-Id: I2a8e3e827991a365758dd106d2ba92a1bd0d7aab Reviewed-by: Michael Brasser <michael.brasser@live.com>
Diffstat (limited to 'src/qml/qml/qqmlvaluetypewrapper.cpp')
-rw-r--r--src/qml/qml/qqmlvaluetypewrapper.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/qml/qml/qqmlvaluetypewrapper.cpp b/src/qml/qml/qqmlvaluetypewrapper.cpp
index fc6eb50ed6..97da7ebf71 100644
--- a/src/qml/qml/qqmlvaluetypewrapper.cpp
+++ b/src/qml/qml/qqmlvaluetypewrapper.cpp
@@ -304,10 +304,12 @@ ReturnedValue QmlValueTypeWrapper::get(Managed *m, String *name, bool *hasProper
if (!result)
return Object::get(m, name, hasProperty);
+ if (hasProperty)
+ *hasProperty = true;
+
if (result->isFunction()) {
// calling a Q_INVOKABLE function of a value type
- QQmlContextData *qmlContext = QV4::QmlContextWrapper::callingContext(v4);
- return QV4::QObjectWrapper::getQmlProperty(v4, qmlContext, r->d()->type, name, QV4::QObjectWrapper::IgnoreRevision);
+ return QV4::QObjectMethod::create(v4->rootContext(), r->d()->type, result->coreIndex);
}
#define VALUE_TYPE_LOAD(metatype, cpptype, constructor) \