aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/qml/qml/qqmlpropertyvalidator.cpp4
-rw-r--r--tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp17
2 files changed, 20 insertions, 1 deletions
diff --git a/src/qml/qml/qqmlpropertyvalidator.cpp b/src/qml/qml/qqmlpropertyvalidator.cpp
index 030497b4b0..590eee2a12 100644
--- a/src/qml/qml/qqmlpropertyvalidator.cpp
+++ b/src/qml/qml/qqmlpropertyvalidator.cpp
@@ -101,7 +101,9 @@ QVector<QQmlError> QQmlPropertyValidator::validateObject(
{
const QV4::CompiledData::Object *obj = compilationUnit->objectAt(objectIndex);
for (auto it = obj->inlineComponentsBegin(); it != obj->inlineComponentsEnd(); ++it) {
- validateObject(it->objectIndex, /* instantiatingBinding*/ nullptr);
+ const auto errors = validateObject(it->objectIndex, /* instantiatingBinding*/ nullptr);
+ if (!errors.isEmpty())
+ return errors;
}
if (obj->flags & QV4::CompiledData::Object::IsComponent && !(obj->flags & QV4::CompiledData::Object::IsInlineComponentRoot)) {
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"