diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2016-02-19 12:49:16 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2016-02-19 12:59:04 +0100 |
commit | 4e7f570f921671c627040537b4dd8cdb77bda3d1 (patch) | |
tree | 7d82e1b6536d5274ab29a3e6307fedcbefd3ce78 /tests/auto/qml/qjsengine | |
parent | 72447b6dbf98ace65ec46559337243970a668d26 (diff) | |
parent | 39df6760e4db6af700c46a420286b51113b5dadb (diff) |
Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
src/quick/items/qquickitem.cpp
tests/auto/quick/qquickgridview/tst_qquickgridview.cpp
tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
Change-Id: I3cf47faa2fe567d62fffd985aeecbefe5811cc42
Diffstat (limited to 'tests/auto/qml/qjsengine')
-rw-r--r-- | tests/auto/qml/qjsengine/tst_qjsengine.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/auto/qml/qjsengine/tst_qjsengine.cpp b/tests/auto/qml/qjsengine/tst_qjsengine.cpp index fe3efcd948..253b050b15 100644 --- a/tests/auto/qml/qjsengine/tst_qjsengine.cpp +++ b/tests/auto/qml/qjsengine/tst_qjsengine.cpp @@ -185,6 +185,8 @@ private slots: void argumentEvaluationOrder(); + void v4FunctionWithoutQML(); + signals: void testSignal(); }; @@ -3794,6 +3796,30 @@ void tst_QJSEngine::argumentEvaluationOrder() } +class TestObject : public QObject +{ + Q_OBJECT +public: + TestObject() : called(false) {} + + bool called; + + Q_INVOKABLE void callMe(QQmlV4Function *) { + called = true; + } +}; + +void tst_QJSEngine::v4FunctionWithoutQML() +{ + TestObject obj; + QJSEngine engine; + QJSValue wrapper = engine.newQObject(&obj); + QQmlEngine::setObjectOwnership(&obj, QQmlEngine::CppOwnership); + QVERIFY(!obj.called); + wrapper.property("callMe").call(); + QVERIFY(obj.called); +} + QTEST_MAIN(tst_QJSEngine) #include "tst_qjsengine.moc" |