From 001596d472557bca08eb93159e724301dea88ad6 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Mon, 8 Feb 2021 16:03:58 +0100 Subject: Return errors if validation of inline components fails Pick-to: 6.0 6.1 Fixes: QTBUG-90038 Change-Id: Ic01b5d097e0b9e6720bcec7ccb18c22abb5418f4 Reviewed-by: Fabian Kosmale --- tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'tests/auto') diff --git a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp index ff76e4510e..401203401e 100644 --- a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp +++ b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp @@ -348,6 +348,7 @@ private slots: void qtbug_85932(); void multiExtension(); + void invalidInlineComponent(); private: QQmlEngine engine; @@ -6151,6 +6152,22 @@ void tst_qqmllanguage::multiExtension() QCOMPARE(o->property("g").toInt(), 44); } +void tst_qqmllanguage::invalidInlineComponent() +{ + QQmlEngine e; + QQmlComponent c(&engine); + c.setData("import QtQuick 2.0\n" + "import QtQuick.Window 2.1\n" + "Window {\n" + " component TestPopup: Window {\n" + " visibility: Window.Windowed\n" + " }\n" + " TestPopup { color: \"blue\" }\n" + "}", QUrl()); + QVERIFY(c.isError()); + QVERIFY(c.errorString().contains("\"Window.visibility\" is not available in QtQuick 2.0.")); +} + QTEST_MAIN(tst_qqmllanguage) #include "tst_qqmllanguage.moc" -- cgit v1.2.3