aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmllanguage/data/component.7.qml
diff options
context:
space:
mode:
authorSami Shalayel <sami.shalayel@qt.io>2022-09-26 17:01:40 +0200
committerSami Shalayel <sami.shalayel@qt.io>2022-09-29 18:19:06 +0200
commitd8066adc55051e305e319bfcd7ded7afbd550418 (patch)
treee8f48c133cef2e07232630f23883a07b85833984 /tests/auto/qml/qqmllanguage/data/component.7.qml
parent4bc3f64b0edc5f097ca7cad4a89a535db67aa266 (diff)
qml: deprecate top-level components
Print a deprecation warning during the IR compilation in the qqmltypecompiler.cpp when a top-level capital-c-Component is found. Also fix all the tests in tst_qqmllanguage that use a top level component (either by wrapping those Components into Items or by removing the explicit redundant Component-wrapping). This implies also fixing the line numbers for Components in tests that got wrapped into an Item. [ChangeLog][QtQml][QQmlComponent] QQmlComponents in qml document roots or in inline component roots are deprecated. Types defined in qml documents or in inline components are automatically wrapped into QQmlComponents when needed: those types really should not be inside a Component{}. Fixes: QTBUG-106547 Change-Id: I00630b879f52f681c98a1d4b804e3505f175b9d6 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'tests/auto/qml/qqmllanguage/data/component.7.qml')
-rw-r--r--tests/auto/qml/qqmllanguage/data/component.7.qml8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/auto/qml/qqmllanguage/data/component.7.qml b/tests/auto/qml/qqmllanguage/data/component.7.qml
index b1a31195eb..0ba54c2c40 100644
--- a/tests/auto/qml/qqmllanguage/data/component.7.qml
+++ b/tests/auto/qml/qqmllanguage/data/component.7.qml
@@ -1,7 +1,9 @@
import QtQuick 2.0
-Component {
- property int a
- QtObject {}
+Item {
+ Component {
+ property int a
+ QtObject {}
+ }
}