diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2021-02-08 16:03:58 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-02-08 21:37:43 +0000 |
commit | 83f69cf2913daf801ef85ef59b6324f6de684455 (patch) | |
tree | 11f267e0cd3832386a791e2a44b90305374a9400 /tests | |
parent | 3dda59305053240d154cab3b35fbcbcc9cfa9042 (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)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp index 5e40387ceb..eaee7883f7 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; @@ -6149,6 +6150,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" |