summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qmlvmemetaobject.cpp
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-10-27 09:39:50 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-10-27 09:39:50 (GMT)
commite92c4b557b07e34a47615a1f7f9a5aff9e981aa6 (patch)
treeea7165707900bee01076f837d936c26aa14150f6 /src/declarative/qml/qmlvmemetaobject.cpp
parent719cf647346f8e81899c45914200fdea2b1b4e2b (diff)
downloadQt-e92c4b557b07e34a47615a1f7f9a5aff9e981aa6.zip
Qt-e92c4b557b07e34a47615a1f7f9a5aff9e981aa6.tar.gz
Qt-e92c4b557b07e34a47615a1f7f9a5aff9e981aa6.tar.bz2
Support return values in synthesized methods
Diffstat (limited to 'src/declarative/qml/qmlvmemetaobject.cpp')
-rw-r--r--src/declarative/qml/qmlvmemetaobject.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/declarative/qml/qmlvmemetaobject.cpp b/src/declarative/qml/qmlvmemetaobject.cpp
index 3e1d931..83f904b 100644
--- a/src/declarative/qml/qmlvmemetaobject.cpp
+++ b/src/declarative/qml/qmlvmemetaobject.cpp
@@ -269,10 +269,11 @@ int QmlVMEMetaObject::metaCall(QMetaObject::Call c, int _id, void **a)
QString code = QString::fromRawData(body, data->bodyLength);
+ QVariant rv;
if (0 == (metaData->methodData() + id)->parameterCount) {
QmlExpression expr(ctxt, code, object);
expr.setTrackChange(false);
- expr.value();
+ rv = expr.value();
} else {
QmlContext newCtxt(ctxt);
QMetaMethod m = method(_id);
@@ -281,8 +282,9 @@ int QmlVMEMetaObject::metaCall(QMetaObject::Call c, int _id, void **a)
newCtxt.setContextProperty(QString::fromLatin1(names.at(ii)), *(QVariant *)a[ii + 1]);
QmlExpression expr(&newCtxt, code, object);
expr.setTrackChange(false);
- expr.value();
+ rv = expr.value();
}
+ if (a[0]) *reinterpret_cast<QVariant *>(a[0]) = rv;
}
return -1;
}