diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2021-02-08 16:03:58 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2021-02-09 11:10:28 +0100 |
commit | 4b2eabdf21ff71d557bae36f99cf3998dafe324c (patch) | |
tree | 062b720a786a6795eeaec614b6215605b6a19732 /tests/auto | |
parent | 9c7b761fe369f8ccd7486acc7d875917613cdeed (diff) |
Return errors if validation of inline components fails
Fixes: QTBUG-90038
Change-Id: Ic01b5d097e0b9e6720bcec7ccb18c22abb5418f4
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 001596d472557bca08eb93159e724301dea88ad6)
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp index c0286bd195..bf818b9005 100644 --- a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp +++ b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp @@ -344,6 +344,8 @@ private slots: void factorySingleton(); void extendedSingleton(); + void invalidInlineComponent(); + private: QQmlEngine engine; QStringList defaultImportPathList; @@ -6087,6 +6089,22 @@ void tst_qqmllanguage::extendedSingleton() QCOMPARE(obj->property("d").toInt(), 9); } +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" |