diff options
3 files changed, 26 insertions, 0 deletions
diff --git a/tests/auto/declarative/qmlecmascript/data/MethodsObject.qml b/tests/auto/declarative/qmlecmascript/data/MethodsObject.qml new file mode 100644 index 0000000..f51ca86 --- /dev/null +++ b/tests/auto/declarative/qmlecmascript/data/MethodsObject.qml @@ -0,0 +1,6 @@ +import Qt 4.6 + +QtObject { + function testFunction() { return 19; } + function testFunction2() { return 18; } +} diff --git a/tests/auto/declarative/qmlecmascript/data/methods.4.qml b/tests/auto/declarative/qmlecmascript/data/methods.4.qml new file mode 100644 index 0000000..aac711c --- /dev/null +++ b/tests/auto/declarative/qmlecmascript/data/methods.4.qml @@ -0,0 +1,11 @@ +import Qt 4.6 + +MethodsObject { + function testFunction2() { return 17; } + function testFunction3() { return 16; } + + property int test: testFunction() + property int test2: testFunction2() + property int test3: testFunction3() +} + diff --git a/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp index f560a90..6f7832a 100644 --- a/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp +++ b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp @@ -206,6 +206,15 @@ void tst_qmlecmascript::methods() QVERIFY(object != 0); QCOMPARE(object->property("test").toInt(), 19); } + + { + QmlComponent component(&engine, TEST_FILE("methods.4.qml")); + QObject *object = component.create(); + QVERIFY(object != 0); + QCOMPARE(object->property("test").toInt(), 19); + QCOMPARE(object->property("test2").toInt(), 17); + QCOMPARE(object->property("test3").toInt(), 16); + } } void tst_qmlecmascript::bindingLoop() |