aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmllint
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qmllint')
-rw-r--r--tests/auto/qml/qmllint/data/AttachedType.qml5
-rw-r--r--tests/auto/qml/qmllint/data/Things/plugins.qmltypes25
-rw-r--r--tests/auto/qml/qmllint/tst_qmllint.cpp1
3 files changed, 31 insertions, 0 deletions
diff --git a/tests/auto/qml/qmllint/data/AttachedType.qml b/tests/auto/qml/qmllint/data/AttachedType.qml
new file mode 100644
index 0000000000..02fa514e83
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/AttachedType.qml
@@ -0,0 +1,5 @@
+import Things 1.0
+
+Item {
+ property real test: Screen.pixelDensity * 0.5
+}
diff --git a/tests/auto/qml/qmllint/data/Things/plugins.qmltypes b/tests/auto/qml/qmllint/data/Things/plugins.qmltypes
index 95ff95eb7d..448a966145 100644
--- a/tests/auto/qml/qmllint/data/Things/plugins.qmltypes
+++ b/tests/auto/qml/qmllint/data/Things/plugins.qmltypes
@@ -30,4 +30,29 @@ Module {
Property { name: "contentData"; type: "QObject"; isList: true; isReadonly: true }
Property { name: "contentChildren"; type: "QQuickItem"; isList: true; isReadonly: true }
}
+ Component {
+ name: "MyScreen"
+ prototype: "QObject"
+ exports: [
+ "Things.Window/Screen 1.0",
+ ]
+ isCreatable: false
+ attachedType: "MyScreenAttached"
+ }
+ Component {
+ name: "MyScreenAttached"
+ prototype: "MyScreenInfo"
+ exports: [
+ "Things.Window/ScreenAttached 1.0",
+ ]
+ }
+ Component {
+ name: "MyScreenInfo"
+ prototype: "QObject"
+ exports: [
+ "Things.Window/ScreenInfo 1.0",
+ ]
+ isCreatable: false
+ Property { name: "pixelDensity"; type: "double"; isReadonly: true }
+ }
}
diff --git a/tests/auto/qml/qmllint/tst_qmllint.cpp b/tests/auto/qml/qmllint/tst_qmllint.cpp
index 7459a813be..d5912def6b 100644
--- a/tests/auto/qml/qmllint/tst_qmllint.cpp
+++ b/tests/auto/qml/qmllint/tst_qmllint.cpp
@@ -223,6 +223,7 @@ void TestQmllint::cleanQmlCode_data()
QTest::newRow("EnumAccess1") << QStringLiteral("EnumAccess1.qml");
QTest::newRow("EnumAccess2") << QStringLiteral("EnumAccess2.qml");
QTest::newRow("ListProperty") << QStringLiteral("ListProperty.qml");
+ QTest::newRow("AttachedType") << QStringLiteral("AttachedType.qml");
}
void TestQmllint::cleanQmlCode()