diff options
Diffstat (limited to 'tests/auto/qml/qmllint/data')
-rw-r--r-- | tests/auto/qml/qmllint/data/CatchStatement.qml | 8 | ||||
-rw-r--r-- | tests/auto/qml/qmllint/data/FromRoot.qml | 17 | ||||
-rw-r--r-- | tests/auto/qml/qmllint/data/IdFromOuterSpace.qml | 9 | ||||
-rw-r--r-- | tests/auto/qml/qmllint/data/SignalHandler.qml | 13 | ||||
-rw-r--r-- | tests/auto/qml/qmllint/data/WithStatement.qml | 13 | ||||
-rw-r--r-- | tests/auto/qml/qmllint/data/catchIdentifierNoWarning.qml | 7 | ||||
-rw-r--r-- | tests/auto/qml/qmllint/data/nonSpuriousParentWarning.qml | 8 | ||||
-rw-r--r-- | tests/auto/qml/qmllint/data/spuriousParentWarning.qml | 7 |
8 files changed, 82 insertions, 0 deletions
diff --git a/tests/auto/qml/qmllint/data/CatchStatement.qml b/tests/auto/qml/qmllint/data/CatchStatement.qml new file mode 100644 index 0000000000..e0f70fce7e --- /dev/null +++ b/tests/auto/qml/qmllint/data/CatchStatement.qml @@ -0,0 +1,8 @@ +import QtQml 2.12 + +QtObject { + function f() { + try {} catch(err) {} + console.log(err); + } +} diff --git a/tests/auto/qml/qmllint/data/FromRoot.qml b/tests/auto/qml/qmllint/data/FromRoot.qml new file mode 100644 index 0000000000..021c09285e --- /dev/null +++ b/tests/auto/qml/qmllint/data/FromRoot.qml @@ -0,0 +1,17 @@ +import QtQuick 2.0 + +Item { + id: root + property int unqualified: 42 + + Item { + Item { + x: unqualified // user defined property from root + } + + QtObject { + property int check: x // existing property from root + } + } + +} diff --git a/tests/auto/qml/qmllint/data/IdFromOuterSpace.qml b/tests/auto/qml/qmllint/data/IdFromOuterSpace.qml new file mode 100644 index 0000000000..774a1cfc7c --- /dev/null +++ b/tests/auto/qml/qmllint/data/IdFromOuterSpace.qml @@ -0,0 +1,9 @@ +import QtQuick 2.0 + +Item { + x: alien.x + + Component.onCompleted: { + console.log(alien); + } +} diff --git a/tests/auto/qml/qmllint/data/SignalHandler.qml b/tests/auto/qml/qmllint/data/SignalHandler.qml new file mode 100644 index 0000000000..865277cedb --- /dev/null +++ b/tests/auto/qml/qmllint/data/SignalHandler.qml @@ -0,0 +1,13 @@ +import QtQuick 2.0 + +MouseArea { + onDoubleClicked: { + console.log(mouse); + // do further things + } + onClicked: console.info(mouse) + onPositionChanged: { + console.log(mouse) + } + onPressAndHold: console.warn(mouse) +} diff --git a/tests/auto/qml/qmllint/data/WithStatement.qml b/tests/auto/qml/qmllint/data/WithStatement.qml new file mode 100644 index 0000000000..5641f21eeb --- /dev/null +++ b/tests/auto/qml/qmllint/data/WithStatement.qml @@ -0,0 +1,13 @@ +import QtQuick 2.0 + +Item { + Item { + id: target + property int test: 42 + } + Component.onCompleted: { + with(target) { + console.log(test); + } + } +} diff --git a/tests/auto/qml/qmllint/data/catchIdentifierNoWarning.qml b/tests/auto/qml/qmllint/data/catchIdentifierNoWarning.qml new file mode 100644 index 0000000000..097baa6fcf --- /dev/null +++ b/tests/auto/qml/qmllint/data/catchIdentifierNoWarning.qml @@ -0,0 +1,7 @@ +import QtQml 2.12 + +QtObject { + function f() { + try {} catch(err) {console.log(err);} + } +} diff --git a/tests/auto/qml/qmllint/data/nonSpuriousParentWarning.qml b/tests/auto/qml/qmllint/data/nonSpuriousParentWarning.qml new file mode 100644 index 0000000000..a59b736929 --- /dev/null +++ b/tests/auto/qml/qmllint/data/nonSpuriousParentWarning.qml @@ -0,0 +1,8 @@ +import QtQuick 2.12 +import QtQml 2.12 + +Item { + QtObject { + property int x: parent.x + } +} diff --git a/tests/auto/qml/qmllint/data/spuriousParentWarning.qml b/tests/auto/qml/qmllint/data/spuriousParentWarning.qml new file mode 100644 index 0000000000..1323593031 --- /dev/null +++ b/tests/auto/qml/qmllint/data/spuriousParentWarning.qml @@ -0,0 +1,7 @@ +import QtQuick 2.12 + +Item { + Unknown { + property int x: parent.x + } +} |