aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlengine
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qqmlengine')
-rw-r--r--tests/auto/qml/qqmlengine/tst_qqmlengine.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp b/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp
index bf964a5744..52e18011cb 100644
--- a/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp
+++ b/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp
@@ -76,6 +76,7 @@ private slots:
void qmlContextProperties();
void testGCCorruption();
void testGroupedPropertyRevisions();
+ void componentFromEval();
public slots:
QObject *createAQObjectForOwnershipTest ()
@@ -885,6 +886,17 @@ void tst_qqmlengine::testGroupedPropertyRevisions()
QVERIFY(!c2.errorString().isEmpty());
}
+void tst_qqmlengine::componentFromEval()
+{
+ QQmlEngine engine;
+ const QUrl testUrl = testFileUrl("EmptyComponent.qml");
+ QJSValue result = engine.evaluate("Qt.createComponent(\"" + testUrl.toString() + "\");");
+ QPointer<QQmlComponent> component(qobject_cast<QQmlComponent*>(result.toQObject()));
+ QVERIFY(!component.isNull());
+ QScopedPointer<QObject> item(component->create());
+ QVERIFY(!item.isNull());
+}
+
QTEST_MAIN(tst_qqmlengine)
#include "tst_qqmlengine.moc"