diff options
Diffstat (limited to 'tests/auto/qml/qqmlinfo/tst_qqmlinfo.cpp')
-rw-r--r-- | tests/auto/qml/qqmlinfo/tst_qqmlinfo.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
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" |