diff options
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/qml/qqmlinfo/data/Component.qml | 8 | ||||
-rw-r--r-- | tests/auto/qml/qqmlinfo/tst_qqmlinfo.cpp | 14 |
2 files changed, 22 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlinfo/data/Component.qml b/tests/auto/qml/qqmlinfo/data/Component.qml new file mode 100644 index 0000000000..fefbbfae76 --- /dev/null +++ b/tests/auto/qml/qqmlinfo/data/Component.qml @@ -0,0 +1,8 @@ +import QtQml 2.0 + +QtObject { + property Component delegate: Component { + QtObject { + } + } +} diff --git a/tests/auto/qml/qqmlinfo/tst_qqmlinfo.cpp b/tests/auto/qml/qqmlinfo/tst_qqmlinfo.cpp index ada3f9e37b..5ff72de0a0 100644 --- a/tests/auto/qml/qqmlinfo/tst_qqmlinfo.cpp +++ b/tests/auto/qml/qqmlinfo/tst_qqmlinfo.cpp @@ -50,6 +50,7 @@ private slots: void types(); void chaining(); void messageTypes(); + void component(); private: QQmlEngine engine; @@ -216,6 +217,19 @@ void tst_qqmlinfo::messageTypes() qmlWarning(nullptr) << QLatin1String("warning"); } +void tst_qqmlinfo::component() +{ + QQmlComponent component(&engine, testFileUrl("Component.qml")); + QScopedPointer<QObject> object(component.create()); + QVERIFY(object != nullptr); + QQmlComponent *delegate = qobject_cast<QQmlComponent*>(object->property("delegate").value<QObject*>()); + QVERIFY(delegate); + + QString message = component.url().toString() + ":4:34: QML Component: Delegate error"; + QTest::ignoreMessage(QtInfoMsg, qPrintable(message)); + qmlInfo(delegate) << "Delegate error"; +} + QTEST_MAIN(tst_qqmlinfo) #include "tst_qqmlinfo.moc" |