diff options
Diffstat (limited to 'tests/auto/qml/qmllint/data')
34 files changed, 214 insertions, 0 deletions
diff --git a/tests/auto/qml/qmllint/data/AttachedProps.qml b/tests/auto/qml/qmllint/data/AttachedProps.qml new file mode 100644 index 0000000000..01be66f866 --- /dev/null +++ b/tests/auto/qml/qmllint/data/AttachedProps.qml @@ -0,0 +1,6 @@ +import QtQml 2.0 + +QtObject { + id: self + property var foo: self.Component.completed +} diff --git a/tests/auto/qml/qmllint/data/AutomatchedSignalHandler.qml b/tests/auto/qml/qmllint/data/AutomatchedSignalHandler.qml new file mode 100644 index 0000000000..064444e182 --- /dev/null +++ b/tests/auto/qml/qmllint/data/AutomatchedSignalHandler.qml @@ -0,0 +1,15 @@ +import QtQuick 2.12 + +Item { + width: 640 + height: 480 + + MouseArea { + anchors.fill: parent + onClicked: console.log("okok") + + Connections { + onClicked: console.log(mouse.x) + } + } +} diff --git a/tests/auto/qml/qmllint/data/ButtonLoader.qml b/tests/auto/qml/qmllint/data/ButtonLoader.qml new file mode 100644 index 0000000000..2721614735 --- /dev/null +++ b/tests/auto/qml/qmllint/data/ButtonLoader.qml @@ -0,0 +1,10 @@ +import QtQuick 2.12 + +Item { + Text { + id: roundButton + Text { + font.pixelSize: roundButton.font.pixelSize * 0.5 + } + } +} diff --git a/tests/auto/qml/qmllint/data/Cycle1.qml b/tests/auto/qml/qmllint/data/Cycle1.qml new file mode 100644 index 0000000000..8095e9f732 --- /dev/null +++ b/tests/auto/qml/qmllint/data/Cycle1.qml @@ -0,0 +1,2 @@ +import QtQml 2.0 +Cycle2 {} diff --git a/tests/auto/qml/qmllint/data/Cycle2.qml b/tests/auto/qml/qmllint/data/Cycle2.qml new file mode 100644 index 0000000000..90c376fcda --- /dev/null +++ b/tests/auto/qml/qmllint/data/Cycle2.qml @@ -0,0 +1,2 @@ +import QtQml 2.0 +Cycle3 {} diff --git a/tests/auto/qml/qmllint/data/Cycle3.qml b/tests/auto/qml/qmllint/data/Cycle3.qml new file mode 100644 index 0000000000..f4cba68653 --- /dev/null +++ b/tests/auto/qml/qmllint/data/Cycle3.qml @@ -0,0 +1,2 @@ +import QtQml 2.0 +Cycle1 {} diff --git a/tests/auto/qml/qmllint/data/Dialog.qml b/tests/auto/qml/qmllint/data/Dialog.qml new file mode 100644 index 0000000000..bde8eae18b --- /dev/null +++ b/tests/auto/qml/qmllint/data/Dialog.qml @@ -0,0 +1,10 @@ +import QtQuick 2.12 + +Item { + id: control + property Text header + header: Text { + font.bold: true + padding: 12 + } +} diff --git a/tests/auto/qml/qmllint/data/Drawer.qml b/tests/auto/qml/qmllint/data/Drawer.qml new file mode 100644 index 0000000000..db1d785c6c --- /dev/null +++ b/tests/auto/qml/qmllint/data/Drawer.qml @@ -0,0 +1,5 @@ +import QtQml 2.12 as T + +T.QtObject { + objectName: T.Component.objectName +} diff --git a/tests/auto/qml/qmllint/data/Form.ui.qml b/tests/auto/qml/qmllint/data/Form.ui.qml new file mode 100644 index 0000000000..459c82afbb --- /dev/null +++ b/tests/auto/qml/qmllint/data/Form.ui.qml @@ -0,0 +1,4 @@ +import QtQuick 2.0 + +Item { +} diff --git a/tests/auto/qml/qmllint/data/FormUser.qml b/tests/auto/qml/qmllint/data/FormUser.qml new file mode 100644 index 0000000000..ea3621586f --- /dev/null +++ b/tests/auto/qml/qmllint/data/FormUser.qml @@ -0,0 +1,7 @@ +import QtQuick 2.0 + +Form { + x: 12 + y: 13 + objectName: "horst" +} diff --git a/tests/auto/qml/qmllint/data/ImportWithPrefix.qml b/tests/auto/qml/qmllint/data/ImportWithPrefix.qml new file mode 100644 index 0000000000..6d070da21a --- /dev/null +++ b/tests/auto/qml/qmllint/data/ImportWithPrefix.qml @@ -0,0 +1,5 @@ +import "." as MyStuff + +MyStuff.Simple { + property bool something: contains(Qt.point(12, 34)) +} diff --git a/tests/auto/qml/qmllint/data/MethodInItem.qml b/tests/auto/qml/qmllint/data/MethodInItem.qml new file mode 100644 index 0000000000..dbdaf8bcc1 --- /dev/null +++ b/tests/auto/qml/qmllint/data/MethodInItem.qml @@ -0,0 +1,5 @@ +import QtQml 2.0 + +QtObject { + function doThings() { console.log("things") } +} diff --git a/tests/auto/qml/qmllint/data/MethodInScope.qml b/tests/auto/qml/qmllint/data/MethodInScope.qml new file mode 100644 index 0000000000..7ba0829f61 --- /dev/null +++ b/tests/auto/qml/qmllint/data/MethodInScope.qml @@ -0,0 +1,5 @@ +import QtQml 2.0 + +MethodInItem { + Component.onCompleted: doThings() +} diff --git a/tests/auto/qml/qmllint/data/Methods.js b/tests/auto/qml/qmllint/data/Methods.js new file mode 100644 index 0000000000..52ab857e38 --- /dev/null +++ b/tests/auto/qml/qmllint/data/Methods.js @@ -0,0 +1,3 @@ +function foo() { + return "ttt" +} diff --git a/tests/auto/qml/qmllint/data/Text.qml b/tests/auto/qml/qmllint/data/Text.qml new file mode 100644 index 0000000000..130578d1e3 --- /dev/null +++ b/tests/auto/qml/qmllint/data/Text.qml @@ -0,0 +1,6 @@ +import QtQuick 2.12 as T + +T.Text { + id: control + text: "'ello" +} diff --git a/tests/auto/qml/qmllint/data/Things/SomethingElse.qml b/tests/auto/qml/qmllint/data/Things/SomethingElse.qml new file mode 100644 index 0000000000..0e69012662 --- /dev/null +++ b/tests/auto/qml/qmllint/data/Things/SomethingElse.qml @@ -0,0 +1,2 @@ +import QtQml 2.0 +QtObject {} diff --git a/tests/auto/qml/qmllint/data/Things/plugins.qmltypes b/tests/auto/qml/qmllint/data/Things/plugins.qmltypes new file mode 100644 index 0000000000..9d81c21070 --- /dev/null +++ b/tests/auto/qml/qmllint/data/Things/plugins.qmltypes @@ -0,0 +1,17 @@ +import QtQuick.tooling 1.2 +Module { + dependencies: [] + Component { + name: "SomethingEntirelyStrange" + prototype: "QObject" + Enum { + name: "AnEnum" + values: { + "AAA": 0, + "BBB": 1, + "CCC": 2 + } + } + Property { name: "palette"; type: "QPalette" } + } +} diff --git a/tests/auto/qml/qmllint/data/Things/qmldir b/tests/auto/qml/qmllint/data/Things/qmldir new file mode 100644 index 0000000000..c53af3a340 --- /dev/null +++ b/tests/auto/qml/qmllint/data/Things/qmldir @@ -0,0 +1,3 @@ +module Things +Something 1.0 SomethingElse.qml +plugin doesNotExistPlugin diff --git a/tests/auto/qml/qmllint/data/badAlias.qml b/tests/auto/qml/qmllint/data/badAlias.qml new file mode 100644 index 0000000000..2dd7d1a7e0 --- /dev/null +++ b/tests/auto/qml/qmllint/data/badAlias.qml @@ -0,0 +1,5 @@ +import QtQml 2.0 + +QtObject { + property alias wrong: nowhere +} diff --git a/tests/auto/qml/qmllint/data/badAliasProperty.qml b/tests/auto/qml/qmllint/data/badAliasProperty.qml new file mode 100644 index 0000000000..9483c52cd0 --- /dev/null +++ b/tests/auto/qml/qmllint/data/badAliasProperty.qml @@ -0,0 +1,6 @@ +import QtQml 2.0 + +QtObject { + id: self + property alias wrong: self.nowhere +} diff --git a/tests/auto/qml/qmllint/data/badParent.qml b/tests/auto/qml/qmllint/data/badParent.qml new file mode 100644 index 0000000000..f381f059cc --- /dev/null +++ b/tests/auto/qml/qmllint/data/badParent.qml @@ -0,0 +1,7 @@ +import QtQuick 2.0 + +Item { + Item { + property int yyy: parent.rrr + } +} diff --git a/tests/auto/qml/qmllint/data/badTypeAssertion.qml b/tests/auto/qml/qmllint/data/badTypeAssertion.qml new file mode 100644 index 0000000000..717fc1b1bb --- /dev/null +++ b/tests/auto/qml/qmllint/data/badTypeAssertion.qml @@ -0,0 +1,6 @@ +import QtQuick 2.0 + +Item { + property QtObject foo: Item { x: 4 } + property real foox: (foo as Item).rrr +} diff --git a/tests/auto/qml/qmllint/data/esmodule.mjs b/tests/auto/qml/qmllint/data/esmodule.mjs new file mode 100644 index 0000000000..50a53be2b1 --- /dev/null +++ b/tests/auto/qml/qmllint/data/esmodule.mjs @@ -0,0 +1,2 @@ + +export function test() { console.log("hello world"); } diff --git a/tests/auto/qml/qmllint/data/forLoop.qml b/tests/auto/qml/qmllint/data/forLoop.qml new file mode 100644 index 0000000000..be8b12409b --- /dev/null +++ b/tests/auto/qml/qmllint/data/forLoop.qml @@ -0,0 +1,9 @@ +import QtQml 2.0 + +QtObject { + Component.onCompleted: { + var stuff = [1, 2, 3, 4] + for (var a in stuff) + console.log(a); + } +} diff --git a/tests/auto/qml/qmllint/data/goodAlias.qml b/tests/auto/qml/qmllint/data/goodAlias.qml new file mode 100644 index 0000000000..d2fa4485ec --- /dev/null +++ b/tests/auto/qml/qmllint/data/goodAlias.qml @@ -0,0 +1,12 @@ +import QtQuick 2.0 + +Item { + id: self + + QtObject { + id: inner + } + + property alias innerObj: inner + property alias name: self.objectName +} diff --git a/tests/auto/qml/qmllint/data/goodParent.qml b/tests/auto/qml/qmllint/data/goodParent.qml new file mode 100644 index 0000000000..413337713a --- /dev/null +++ b/tests/auto/qml/qmllint/data/goodParent.qml @@ -0,0 +1,8 @@ +import QtQuick 2.0 + +Item { + property int rrr: 5 + Item { + property int yyy: parent.rrr + } +} diff --git a/tests/auto/qml/qmllint/data/goodTypeAssertion.qml b/tests/auto/qml/qmllint/data/goodTypeAssertion.qml new file mode 100644 index 0000000000..6f5f52eb6b --- /dev/null +++ b/tests/auto/qml/qmllint/data/goodTypeAssertion.qml @@ -0,0 +1,6 @@ +import QtQuick 2.0 + +Item { + property QtObject foo: Item { x: 4 } + property real foox: (foo as Item).x +} diff --git a/tests/auto/qml/qmllint/data/incompleteQmltypes.qml b/tests/auto/qml/qmllint/data/incompleteQmltypes.qml new file mode 100644 index 0000000000..ab06bbd8b0 --- /dev/null +++ b/tests/auto/qml/qmllint/data/incompleteQmltypes.qml @@ -0,0 +1,6 @@ +import Things 1.0 + +SomethingEntirelyStrange { + id: self + property var a: self.palette.weDontKnowIt +} diff --git a/tests/auto/qml/qmllint/data/javascriptMethods.qml b/tests/auto/qml/qmllint/data/javascriptMethods.qml new file mode 100644 index 0000000000..62ddcfda60 --- /dev/null +++ b/tests/auto/qml/qmllint/data/javascriptMethods.qml @@ -0,0 +1,6 @@ +import QtQml 2.0 +import "Methods.js" as Methods + +QtObject { + objectName: Methods.foo() +} diff --git a/tests/auto/qml/qmllint/data/memberNotFound.qml b/tests/auto/qml/qmllint/data/memberNotFound.qml new file mode 100644 index 0000000000..da2e353227 --- /dev/null +++ b/tests/auto/qml/qmllint/data/memberNotFound.qml @@ -0,0 +1,7 @@ +import QtQml 2.0 + +QtObject { + id: self + property string n: self.objectName + property string not: self.foo +} diff --git a/tests/auto/qml/qmllint/data/parentIsComponent.qml b/tests/auto/qml/qmllint/data/parentIsComponent.qml new file mode 100644 index 0000000000..a74bf9e4e8 --- /dev/null +++ b/tests/auto/qml/qmllint/data/parentIsComponent.qml @@ -0,0 +1,13 @@ +import QtQuick 2.0 + +Item { + Component { + id: foo + Item { + property real yyy: parent.progress + Component.onCompleted: console.log(yyy) + } + } + + property var stuff: foo.createObject() +} diff --git a/tests/auto/qml/qmllint/data/qmldirAndQmltypes.qml b/tests/auto/qml/qmllint/data/qmldirAndQmltypes.qml new file mode 100644 index 0000000000..4847fc9196 --- /dev/null +++ b/tests/auto/qml/qmllint/data/qmldirAndQmltypes.qml @@ -0,0 +1,6 @@ +import Things 1.0 + +Something { + property var a: SomethingEntirelyStrange {} + property var b: SomethingEntirelyStrange.AAA +} diff --git a/tests/auto/qml/qmllint/data/spuriousParentWarning.qml b/tests/auto/qml/qmllint/data/unknownElement.qml index 1323593031..1323593031 100644 --- a/tests/auto/qml/qmllint/data/spuriousParentWarning.qml +++ b/tests/auto/qml/qmllint/data/unknownElement.qml diff --git a/tests/auto/qml/qmllint/data/unknownJavascriptMethod.qml b/tests/auto/qml/qmllint/data/unknownJavascriptMethod.qml new file mode 100644 index 0000000000..2718e07c60 --- /dev/null +++ b/tests/auto/qml/qmllint/data/unknownJavascriptMethod.qml @@ -0,0 +1,6 @@ +import QtQml 2.0 +import "Methods.js" as Methods + +QtObject { + objectName: Methods.foo2() +} |