aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmllint/data
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qmllint/data')
-rw-r--r--tests/auto/qml/qmllint/data/Cycle/MenuItem.qml3
-rw-r--r--tests/auto/qml/qmllint/data/Cycle/qmldir3
-rw-r--r--tests/auto/qml/qmllint/data/LazyAndDirect/Direct.qml5
-rw-r--r--tests/auto/qml/qmllint/data/LazyAndDirect/Lazy.qml8
-rw-r--r--tests/auto/qml/qmllint/data/LazyAndDirect/qmldir4
-rw-r--r--tests/auto/qml/qmllint/data/Qt5Compat/GraphicalEffects/private/qmldir2
-rw-r--r--tests/auto/qml/qmllint/data/Things/LintDirectly.qml4
-rw-r--r--tests/auto/qml/qmllint/data/Things/NotPartOfThings.qml3
-rw-r--r--tests/auto/qml/qmllint/data/accessibleId.qml14
-rw-r--r--tests/auto/qml/qmllint/data/animationEasing.qml5
-rw-r--r--tests/auto/qml/qmllint/data/badScript.attached.qml4
-rw-r--r--tests/auto/qml/qmllint/data/badScriptBinding.attached.qml6
-rw-r--r--tests/auto/qml/qmllint/data/badScriptBinding.attachedSignalHandler.qml7
-rw-r--r--tests/auto/qml/qmllint/data/badScriptBinding.group.qml4
-rw-r--r--tests/auto/qml/qmllint/data/cachedDependency.qml23
-rw-r--r--tests/auto/qml/qmllint/data/connectionNoParent.qml5
-rw-r--r--tests/auto/qml/qmllint/data/cycleHead.qml7
-rw-r--r--tests/auto/qml/qmllint/data/goodAttachedPropertyAccess.qml3
-rw-r--r--tests/auto/qml/qmllint/data/goodBindingsOnGroupAndAttached.qml11
-rw-r--r--tests/auto/qml/qmllint/data/inaccessibleId.qml12
-rw-r--r--tests/auto/qml/qmllint/data/inaccessibleId2.qml10
-rw-r--r--tests/auto/qml/qmllint/data/invalidId1.qml5
-rw-r--r--tests/auto/qml/qmllint/data/missingBuiltinsNoCrash.qml3
-rw-r--r--tests/auto/qml/qmllint/data/missingQmltypes.qml4
-rw-r--r--tests/auto/qml/qmllint/data/multiGrouped.qml6
-rw-r--r--tests/auto/qml/qmllint/data/onBindingInGroupedProperty.qml10
-rw-r--r--tests/auto/qml/qmllint/data/prefixedAttachedProperty.qml5
-rw-r--r--tests/auto/qml/qmllint/data/qmodelIndex.qml6
-rw-r--r--tests/auto/qml/qmllint/data/requiredProperty.qml12
-rw-r--r--tests/auto/qml/qmllint/data/requiredPropertyInComponent.qml25
-rw-r--r--tests/auto/qml/qmllint/data/settings/bare/.qmllint.ini2
-rw-r--r--tests/auto/qml/qmllint/data/settings/bare/bare.qml3
-rw-r--r--tests/auto/qml/qmllint/data/settings/qmltypes/.qmllint.ini2
-rw-r--r--tests/auto/qml/qmllint/data/settings/qmltypes/custom.qmltypes11
-rw-r--r--tests/auto/qml/qmllint/data/settings/qmltypes/qmltypes.qml3
-rw-r--r--tests/auto/qml/qmllint/data/stringAsId.qml5
-rw-r--r--tests/auto/qml/qmllint/data/stringIdUsedInWarning.qml9
37 files changed, 249 insertions, 5 deletions
diff --git a/tests/auto/qml/qmllint/data/Cycle/MenuItem.qml b/tests/auto/qml/qmllint/data/Cycle/MenuItem.qml
new file mode 100644
index 0000000000..b316a5432c
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/Cycle/MenuItem.qml
@@ -0,0 +1,3 @@
+import QtQml
+
+MenuItem {}
diff --git a/tests/auto/qml/qmllint/data/Cycle/qmldir b/tests/auto/qml/qmllint/data/Cycle/qmldir
new file mode 100644
index 0000000000..6b0ba5519a
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/Cycle/qmldir
@@ -0,0 +1,3 @@
+module Cycle
+
+MenuItem 1.0 MenuItem.qml
diff --git a/tests/auto/qml/qmllint/data/LazyAndDirect/Direct.qml b/tests/auto/qml/qmllint/data/LazyAndDirect/Direct.qml
new file mode 100644
index 0000000000..fcb08c1e80
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/LazyAndDirect/Direct.qml
@@ -0,0 +1,5 @@
+import QtQml
+
+QtObject {
+ Component.onCompleted: Lazy.setDirect(this)
+}
diff --git a/tests/auto/qml/qmllint/data/LazyAndDirect/Lazy.qml b/tests/auto/qml/qmllint/data/LazyAndDirect/Lazy.qml
new file mode 100644
index 0000000000..1f69d0f16a
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/LazyAndDirect/Lazy.qml
@@ -0,0 +1,8 @@
+pragma Singleton
+import QtQml
+
+QtObject {
+ property Direct direct
+
+ function setDirect(newDirect : Direct) { direct = newDirect }
+}
diff --git a/tests/auto/qml/qmllint/data/LazyAndDirect/qmldir b/tests/auto/qml/qmllint/data/LazyAndDirect/qmldir
new file mode 100644
index 0000000000..ebc7f2a157
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/LazyAndDirect/qmldir
@@ -0,0 +1,4 @@
+module LazyAndDirect
+
+Direct 1.0 Direct.qml
+singleton Lazy 1.0 Lazy.qml
diff --git a/tests/auto/qml/qmllint/data/Qt5Compat/GraphicalEffects/private/qmldir b/tests/auto/qml/qmllint/data/Qt5Compat/GraphicalEffects/private/qmldir
new file mode 100644
index 0000000000..b13cdc9c3e
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/Qt5Compat/GraphicalEffects/private/qmldir
@@ -0,0 +1,2 @@
+module Qt5Compat.GraphicalEffects.private
+typeinfo plugins.qmltypes
diff --git a/tests/auto/qml/qmllint/data/Things/LintDirectly.qml b/tests/auto/qml/qmllint/data/Things/LintDirectly.qml
new file mode 100644
index 0000000000..4384fa99f4
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/Things/LintDirectly.qml
@@ -0,0 +1,4 @@
+Pane {
+ property var thing: NotPartOfThings {}
+ property var something: Something {}
+}
diff --git a/tests/auto/qml/qmllint/data/Things/NotPartOfThings.qml b/tests/auto/qml/qmllint/data/Things/NotPartOfThings.qml
new file mode 100644
index 0000000000..16fd397d1d
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/Things/NotPartOfThings.qml
@@ -0,0 +1,3 @@
+import QtQuick
+
+Component {}
diff --git a/tests/auto/qml/qmllint/data/accessibleId.qml b/tests/auto/qml/qmllint/data/accessibleId.qml
new file mode 100644
index 0000000000..904b856320
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/accessibleId.qml
@@ -0,0 +1,14 @@
+import QtQml
+
+QtObject {
+ id: a
+ property Component c: Component {
+ QtObject {
+ id: a
+ property QtObject o: QtObject {
+ property int a: 5
+ objectName: a.objectName
+ }
+ }
+ }
+}
diff --git a/tests/auto/qml/qmllint/data/animationEasing.qml b/tests/auto/qml/qmllint/data/animationEasing.qml
new file mode 100644
index 0000000000..1b0c9ffea4
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/animationEasing.qml
@@ -0,0 +1,5 @@
+import QtQml
+import QtQuick
+NumberAnimation {
+ easing.type: Easing.InOutQuad
+}
diff --git a/tests/auto/qml/qmllint/data/badScript.attached.qml b/tests/auto/qml/qmllint/data/badScript.attached.qml
new file mode 100644
index 0000000000..f3183430fc
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/badScript.attached.qml
@@ -0,0 +1,4 @@
+import QtQuick
+Text {
+ font.pixelSize: 10 + pointSize * 0.1 // pointSize does not exist in the scope of the binding
+}
diff --git a/tests/auto/qml/qmllint/data/badScriptBinding.attached.qml b/tests/auto/qml/qmllint/data/badScriptBinding.attached.qml
new file mode 100644
index 0000000000..a5ec7d9050
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/badScriptBinding.attached.qml
@@ -0,0 +1,6 @@
+import QtQuick.Layouts
+RowLayout {
+ function returnTrue() { return true; }
+ Layout.fillWidth: returnTrue()
+ Layout.bogusProperty: returnTrue()
+}
diff --git a/tests/auto/qml/qmllint/data/badScriptBinding.attachedSignalHandler.qml b/tests/auto/qml/qmllint/data/badScriptBinding.attachedSignalHandler.qml
new file mode 100644
index 0000000000..56d89a81da
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/badScriptBinding.attachedSignalHandler.qml
@@ -0,0 +1,7 @@
+import QtQuick
+Rectangle {
+ Keys.onBogusSignal: function(event) {
+ // the handler is good, but the signal doesn't exist
+ console.log(event);
+ }
+}
diff --git a/tests/auto/qml/qmllint/data/badScriptBinding.group.qml b/tests/auto/qml/qmllint/data/badScriptBinding.group.qml
new file mode 100644
index 0000000000..d92feb81f0
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/badScriptBinding.group.qml
@@ -0,0 +1,4 @@
+import QtQuick
+Text {
+ font.bogusProperty: "foo" + "bar"
+}
diff --git a/tests/auto/qml/qmllint/data/cachedDependency.qml b/tests/auto/qml/qmllint/data/cachedDependency.qml
new file mode 100644
index 0000000000..5a15a66997
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/cachedDependency.qml
@@ -0,0 +1,23 @@
+import QtQuick.Controls.impl // Caches QtQuick as depedency, without QML names
+import QtQuick
+
+Item {
+ QtObject { id: object }
+ Item { id: item }
+ Rectangle { id: rectangle }
+
+ // Various ways to cast between types contained in QtQuick and QtQml
+ // The QML names of both have to be available for this to work
+
+ property QtObject objectAsObject: object as QtObject
+ property QtObject objectAsItem: object as Item
+ property QtObject objectAsRectangle: object as Rectangle
+
+ property QtObject itemAsObject: item as QtObject
+ property QtObject itemAsItem: item as Item
+ property QtObject itemAsRectangle: item as Rectangle
+
+ property QtObject rectangleAsObject: rectangle as QtObject
+ property QtObject rectangleAsItem: rectangle as Item
+ property QtObject rectangleAsRectangle: rectangle as Rectangle
+}
diff --git a/tests/auto/qml/qmllint/data/connectionNoParent.qml b/tests/auto/qml/qmllint/data/connectionNoParent.qml
new file mode 100644
index 0000000000..27f7e22cf3
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/connectionNoParent.qml
@@ -0,0 +1,5 @@
+import QtQuick
+
+Connections {
+ function onClicked() {}
+}
diff --git a/tests/auto/qml/qmllint/data/cycleHead.qml b/tests/auto/qml/qmllint/data/cycleHead.qml
new file mode 100644
index 0000000000..080eab381f
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/cycleHead.qml
@@ -0,0 +1,7 @@
+import Cycle
+import QtQuick
+
+Item {
+ property MenuItem item: a
+ MenuItem { id: a }
+}
diff --git a/tests/auto/qml/qmllint/data/goodAttachedPropertyAccess.qml b/tests/auto/qml/qmllint/data/goodAttachedPropertyAccess.qml
index c46370521a..b7f64d9acb 100644
--- a/tests/auto/qml/qmllint/data/goodAttachedPropertyAccess.qml
+++ b/tests/auto/qml/qmllint/data/goodAttachedPropertyAccess.qml
@@ -6,6 +6,9 @@ QtObject {
}
Component.onCompleted: {
+ // NB: this currently fails as TestType.object is recognized as QtObject
+ // *exactly*, ignoring the QML code above and thus there's no 'progress'
+ // property on TestType.object
console.log(TestType.object.progress);
}
}
diff --git a/tests/auto/qml/qmllint/data/goodBindingsOnGroupAndAttached.qml b/tests/auto/qml/qmllint/data/goodBindingsOnGroupAndAttached.qml
new file mode 100644
index 0000000000..7a89b82f6e
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/goodBindingsOnGroupAndAttached.qml
@@ -0,0 +1,11 @@
+import QtQuick
+Rectangle {
+ Text {
+ font.pixelSize: 42
+ }
+
+ Keys.enabled: false
+ Keys.onPressed: function(event) {
+ console.log(event);
+ }
+}
diff --git a/tests/auto/qml/qmllint/data/inaccessibleId.qml b/tests/auto/qml/qmllint/data/inaccessibleId.qml
new file mode 100644
index 0000000000..a3489f4741
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/inaccessibleId.qml
@@ -0,0 +1,12 @@
+import QtQml
+
+QtObject {
+ id: a
+
+ property Component c: Component {
+ QtObject {
+ property int a: 5
+ objectName: a.objectName
+ }
+ }
+}
diff --git a/tests/auto/qml/qmllint/data/inaccessibleId2.qml b/tests/auto/qml/qmllint/data/inaccessibleId2.qml
new file mode 100644
index 0000000000..b8f381b0b7
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/inaccessibleId2.qml
@@ -0,0 +1,10 @@
+import QtQml
+
+QtObject {
+ id: a
+
+ component Handle: QtObject {
+ property int a: 5
+ objectName: a.objectName
+ }
+}
diff --git a/tests/auto/qml/qmllint/data/invalidId1.qml b/tests/auto/qml/qmllint/data/invalidId1.qml
new file mode 100644
index 0000000000..61c45530f1
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/invalidId1.qml
@@ -0,0 +1,5 @@
+import QtQml
+
+QtObject {
+ id: foo.bar
+}
diff --git a/tests/auto/qml/qmllint/data/missingBuiltinsNoCrash.qml b/tests/auto/qml/qmllint/data/missingBuiltinsNoCrash.qml
new file mode 100644
index 0000000000..a2f7d422b3
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/missingBuiltinsNoCrash.qml
@@ -0,0 +1,3 @@
+import QtQuick // This can't be found if --bare is specified and no paths are provided
+
+Item {}
diff --git a/tests/auto/qml/qmllint/data/missingQmltypes.qml b/tests/auto/qml/qmllint/data/missingQmltypes.qml
new file mode 100644
index 0000000000..19a6dbd10b
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/missingQmltypes.qml
@@ -0,0 +1,4 @@
+import QtQml
+import Qt5Compat.GraphicalEffects.private
+
+QtObject {}
diff --git a/tests/auto/qml/qmllint/data/multiGrouped.qml b/tests/auto/qml/qmllint/data/multiGrouped.qml
new file mode 100644
index 0000000000..ab6bd5bd02
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/multiGrouped.qml
@@ -0,0 +1,6 @@
+import QtQuick
+
+Item {
+ anchors.verticalCenter: parent.verticalCenter
+ anchors { right: parent.left }
+}
diff --git a/tests/auto/qml/qmllint/data/onBindingInGroupedProperty.qml b/tests/auto/qml/qmllint/data/onBindingInGroupedProperty.qml
new file mode 100644
index 0000000000..186b8a557f
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/onBindingInGroupedProperty.qml
@@ -0,0 +1,10 @@
+import QtQuick
+
+Rectangle
+{
+ id: root
+ border
+ {
+ ColorAnimation on color { }
+ }
+}
diff --git a/tests/auto/qml/qmllint/data/prefixedAttachedProperty.qml b/tests/auto/qml/qmllint/data/prefixedAttachedProperty.qml
new file mode 100644
index 0000000000..1f9634e280
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/prefixedAttachedProperty.qml
@@ -0,0 +1,5 @@
+import QtQuick as T
+
+T.Item {
+ T.Accessible.name: "Example"
+}
diff --git a/tests/auto/qml/qmllint/data/qmodelIndex.qml b/tests/auto/qml/qmllint/data/qmodelIndex.qml
new file mode 100644
index 0000000000..e0df84b68b
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/qmodelIndex.qml
@@ -0,0 +1,6 @@
+import QtQml
+
+QtObject {
+ property ItemSelectionModel itemSelectionModel;
+ function row() { return itemSelectionModel.currentIndex.row; }
+}
diff --git a/tests/auto/qml/qmllint/data/requiredProperty.qml b/tests/auto/qml/qmllint/data/requiredProperty.qml
index 6e0eec54e7..f1e82bb402 100644
--- a/tests/auto/qml/qmllint/data/requiredProperty.qml
+++ b/tests/auto/qml/qmllint/data/requiredProperty.qml
@@ -1,7 +1,9 @@
-import QtQml 2.15
+import QtQuick 2.15
-QtObject {
- property int x
- required x
- x: 5
+Item {
+ component Required : QtObject {
+ property int x
+ required x
+ }
+ Required { x: 5 }
}
diff --git a/tests/auto/qml/qmllint/data/requiredPropertyInComponent.qml b/tests/auto/qml/qmllint/data/requiredPropertyInComponent.qml
new file mode 100644
index 0000000000..24ecf9d706
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/requiredPropertyInComponent.qml
@@ -0,0 +1,25 @@
+import QtQuick 2.0
+
+Row {
+ // explicit component
+ Component {
+ id: foo
+ Item {
+ required property int i
+ }
+ }
+
+ // implicit component, plain property
+ property Component com: Item {}
+
+ Repeater {
+ model: 3
+ // implicit component, default property
+ Text {
+ required property int index
+ height: 40
+ color: "black"
+ text: "I'm item " + index
+ }
+ }
+}
diff --git a/tests/auto/qml/qmllint/data/settings/bare/.qmllint.ini b/tests/auto/qml/qmllint/data/settings/bare/.qmllint.ini
new file mode 100644
index 0000000000..e419c37f3a
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/settings/bare/.qmllint.ini
@@ -0,0 +1,2 @@
+[Foo]
+DisableDefaultImports=true
diff --git a/tests/auto/qml/qmllint/data/settings/bare/bare.qml b/tests/auto/qml/qmllint/data/settings/bare/bare.qml
new file mode 100644
index 0000000000..852b8339b9
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/settings/bare/bare.qml
@@ -0,0 +1,3 @@
+import QtQuick // Should fail because Bare is specified with no import
+
+Item {}
diff --git a/tests/auto/qml/qmllint/data/settings/qmltypes/.qmllint.ini b/tests/auto/qml/qmllint/data/settings/qmltypes/.qmllint.ini
new file mode 100644
index 0000000000..95b02f2f37
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/settings/qmltypes/.qmllint.ini
@@ -0,0 +1,2 @@
+[General]
+OverwriteImportTypes=custom.qmltypes
diff --git a/tests/auto/qml/qmllint/data/settings/qmltypes/custom.qmltypes b/tests/auto/qml/qmllint/data/settings/qmltypes/custom.qmltypes
new file mode 100644
index 0000000000..b3839652dc
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/settings/qmltypes/custom.qmltypes
@@ -0,0 +1,11 @@
+import QtQuick.tooling 1.2
+Module {
+ dependencies: []
+ Component {
+ name: "Thing"
+ prototype: "QObject"
+ exports: [
+ "Custom/Thing 1.0",
+ ]
+ }
+}
diff --git a/tests/auto/qml/qmllint/data/settings/qmltypes/qmltypes.qml b/tests/auto/qml/qmllint/data/settings/qmltypes/qmltypes.qml
new file mode 100644
index 0000000000..221ddff254
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/settings/qmltypes/qmltypes.qml
@@ -0,0 +1,3 @@
+import Custom
+
+Thing {}
diff --git a/tests/auto/qml/qmllint/data/stringAsId.qml b/tests/auto/qml/qmllint/data/stringAsId.qml
new file mode 100644
index 0000000000..58ea28cb17
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/stringAsId.qml
@@ -0,0 +1,5 @@
+import QtQml
+
+QtObject {
+ id: "aString"
+}
diff --git a/tests/auto/qml/qmllint/data/stringIdUsedInWarning.qml b/tests/auto/qml/qmllint/data/stringIdUsedInWarning.qml
new file mode 100644
index 0000000000..672c00f39b
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/stringIdUsedInWarning.qml
@@ -0,0 +1,9 @@
+import QtQml
+
+QtObject {
+ id: "stringy"
+ property int i
+ property QtObject o: QtObject {
+ Component.onCompleted: console.log(i)
+ }
+}