diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-10-27 09:39:50 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-10-27 09:39:50 (GMT) |
commit | e92c4b557b07e34a47615a1f7f9a5aff9e981aa6 (patch) | |
tree | ea7165707900bee01076f837d936c26aa14150f6 /tests/auto/declarative | |
parent | 719cf647346f8e81899c45914200fdea2b1b4e2b (diff) | |
download | Qt-e92c4b557b07e34a47615a1f7f9a5aff9e981aa6.zip Qt-e92c4b557b07e34a47615a1f7f9a5aff9e981aa6.tar.gz Qt-e92c4b557b07e34a47615a1f7f9a5aff9e981aa6.tar.bz2 |
Support return values in synthesized methods
Diffstat (limited to 'tests/auto/declarative')
-rw-r--r-- | tests/auto/declarative/qmlecmascript/data/methods.3.qml | 7 | ||||
-rw-r--r-- | tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp | 7 |
2 files changed, 14 insertions, 0 deletions
diff --git a/tests/auto/declarative/qmlecmascript/data/methods.3.qml b/tests/auto/declarative/qmlecmascript/data/methods.3.qml new file mode 100644 index 0000000..2efcf6a --- /dev/null +++ b/tests/auto/declarative/qmlecmascript/data/methods.3.qml @@ -0,0 +1,7 @@ +import Qt 4.6 + +Object { + function testFunction() { return 19; } + + property int test: testFunction() +} diff --git a/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp index a0e65c5..67a98b1 100644 --- a/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp +++ b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp @@ -152,6 +152,13 @@ void tst_qmlecmascript::methods() QCOMPARE(object->methodCalled(), false); QCOMPARE(object->methodIntCalled(), true); } + + { + QmlComponent component(&engine, TEST_FILE("methods.3.qml")); + QObject *object = component.create(); + QVERIFY(object != 0); + QCOMPARE(object->property("test").toInt(), 19); + } } void tst_qmlecmascript::bindingLoop() |