aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmllanguage/data
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qqmllanguage/data')
-rw-r--r--tests/auto/qml/qqmllanguage/data/Broken.qml5
-rw-r--r--tests/auto/qml/qqmllanguage/data/ComponentType.qml8
-rw-r--r--tests/auto/qml/qqmllanguage/data/GroupFailureInner.qml2
-rw-r--r--tests/auto/qml/qqmllanguage/data/GroupFailureOuter.qml5
-rw-r--r--tests/auto/qml/qqmllanguage/data/MyRectangle.qml10
-rw-r--r--tests/auto/qml/qqmllanguage/data/SignalInlineComponentArg.qml21
-rw-r--r--tests/auto/qml/qqmllanguage/data/alias.15.qml21
-rw-r--r--tests/auto/qml/qqmllanguage/data/alias.15a.qml12
-rw-r--r--tests/auto/qml/qqmllanguage/data/alias.19.qml11
-rw-r--r--tests/auto/qml/qqmllanguage/data/ambiguousBinding/TestCase.qml6
-rw-r--r--tests/auto/qml/qqmllanguage/data/ambiguousBinding/ambiguousContainingType.qml3
-rw-r--r--tests/auto/qml/qqmllanguage/data/asBroken.qml6
-rw-r--r--tests/auto/qml/qqmllanguage/data/badGroupedProperty.qml10
-rw-r--r--tests/auto/qml/qqmllanguage/data/bindingAliasToComponentUrl.qml10
-rw-r--r--tests/auto/qml/qqmllanguage/data/bindingAliasToComponentUrl2.qml11
-rw-r--r--tests/auto/qml/qqmllanguage/data/componentMix.qml18
-rw-r--r--tests/auto/qml/qqmllanguage/data/foreignExtended.qml7
-rw-r--r--tests/auto/qml/qqmllanguage/data/fuzzed.1.errors.txt3
-rw-r--r--tests/auto/qml/qqmllanguage/data/groupFailure.qml5
-rw-r--r--tests/auto/qml/qqmllanguage/data/jittedAsCast.qml15
-rw-r--r--tests/auto/qml/qqmllanguage/data/sameNameAliasProperty.qml7
-rw-r--r--tests/auto/qml/qqmllanguage/data/sameNamePropertyAlias.qml7
-rw-r--r--tests/auto/qml/qqmllanguage/data/signalInlineComponentArg1.qml30
-rw-r--r--tests/auto/qml/qqmllanguage/data/thisInArrow.qml39
-rw-r--r--tests/auto/qml/qqmllanguage/data/uncreatableAttached.qml8
-rw-r--r--tests/auto/qml/qqmllanguage/data/variantListConversion.qml3
26 files changed, 279 insertions, 4 deletions
diff --git a/tests/auto/qml/qqmllanguage/data/Broken.qml b/tests/auto/qml/qqmllanguage/data/Broken.qml
new file mode 100644
index 0000000000..e1b61f31f4
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/Broken.qml
@@ -0,0 +1,5 @@
+import QtQml
+
+QtObject {
+ notThere: 5
+}
diff --git a/tests/auto/qml/qqmllanguage/data/ComponentType.qml b/tests/auto/qml/qqmllanguage/data/ComponentType.qml
new file mode 100644
index 0000000000..e8addde1c4
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/ComponentType.qml
@@ -0,0 +1,8 @@
+import QtQml
+
+Component {
+ id: componentRoot
+ QtObject {
+ objectName: "enclosed"
+ }
+}
diff --git a/tests/auto/qml/qqmllanguage/data/GroupFailureInner.qml b/tests/auto/qml/qqmllanguage/data/GroupFailureInner.qml
new file mode 100644
index 0000000000..7972cc9683
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/GroupFailureInner.qml
@@ -0,0 +1,2 @@
+import QtQml
+QtObject { property url u }
diff --git a/tests/auto/qml/qqmllanguage/data/GroupFailureOuter.qml b/tests/auto/qml/qqmllanguage/data/GroupFailureOuter.qml
new file mode 100644
index 0000000000..2a34a29789
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/GroupFailureOuter.qml
@@ -0,0 +1,5 @@
+import QtQml
+
+QtObject {
+ property GroupFailureInner b
+}
diff --git a/tests/auto/qml/qqmllanguage/data/MyRectangle.qml b/tests/auto/qml/qqmllanguage/data/MyRectangle.qml
new file mode 100644
index 0000000000..4d5e7c6c8d
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/MyRectangle.qml
@@ -0,0 +1,10 @@
+import QtQuick
+
+Item {
+ property alias rectangle1AnchorsleftMargin: rectangle1.anchors.leftMargin
+
+ Rectangle {
+ id: rectangle1
+ anchors.leftMargin: 250
+ }
+}
diff --git a/tests/auto/qml/qqmllanguage/data/SignalInlineComponentArg.qml b/tests/auto/qml/qqmllanguage/data/SignalInlineComponentArg.qml
new file mode 100644
index 0000000000..0424ac1534
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/SignalInlineComponentArg.qml
@@ -0,0 +1,21 @@
+import QtQuick
+
+Item {
+ component Abc: Item {
+ property string success
+ }
+
+ signal canYouFeelIt(arg1: Abc)
+ property Abc someAbc: Abc {
+ success: "Signal was called"
+ }
+ property string success: "Signal not called yet"
+
+ Component.onCompleted: {
+ canYouFeelIt(someAbc);
+ }
+
+ onCanYouFeelIt: (arg) => {
+ success = arg.success
+ }
+}
diff --git a/tests/auto/qml/qqmllanguage/data/alias.15.qml b/tests/auto/qml/qqmllanguage/data/alias.15.qml
index 5f3de9c83e..7e362d8823 100644
--- a/tests/auto/qml/qqmllanguage/data/alias.15.qml
+++ b/tests/auto/qml/qqmllanguage/data/alias.15.qml
@@ -9,4 +9,25 @@ Item {
Item {
id: symbol
}
+
+ Rectangle {
+ id: txtElevationValue
+
+ property Rectangle background: Rectangle { }
+
+ state: "ValidatorInvalid"
+
+ states: [
+ State {
+ name: "ValidatorInvalid"
+ PropertyChanges {
+ target: txtElevationValue
+ background.border.color: "red" // this line caused the segfault in qtbug107795
+ }
+ },
+ State {
+ name: "ValidatorAcceptable"
+ }
+ ]
+ }
}
diff --git a/tests/auto/qml/qqmllanguage/data/alias.15a.qml b/tests/auto/qml/qqmllanguage/data/alias.15a.qml
new file mode 100644
index 0000000000..ba8097c997
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/alias.15a.qml
@@ -0,0 +1,12 @@
+import QtQuick 2.15
+
+Item {
+ id: root
+
+ property alias symbol: symbol
+ symbol.layer.enabled: true
+
+ Item {
+ id: symbol
+ }
+}
diff --git a/tests/auto/qml/qqmllanguage/data/alias.19.qml b/tests/auto/qml/qqmllanguage/data/alias.19.qml
new file mode 100644
index 0000000000..a96c0c694d
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/alias.19.qml
@@ -0,0 +1,11 @@
+import QtQuick
+
+Item {
+ id: myThing
+ width: 1920
+
+ MyRectangle {
+ rectangle1AnchorsleftMargin: myThing.width / 2
+ Component.onCompleted: myThing.height = rectangle1AnchorsleftMargin
+ }
+}
diff --git a/tests/auto/qml/qqmllanguage/data/ambiguousBinding/TestCase.qml b/tests/auto/qml/qqmllanguage/data/ambiguousBinding/TestCase.qml
new file mode 100644
index 0000000000..c76d2b679e
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/ambiguousBinding/TestCase.qml
@@ -0,0 +1,6 @@
+import QtQml 2.15
+import QtTest 1.0
+
+QtObject {
+ component Comp: QtObject {}
+}
diff --git a/tests/auto/qml/qqmllanguage/data/ambiguousBinding/ambiguousContainingType.qml b/tests/auto/qml/qqmllanguage/data/ambiguousBinding/ambiguousContainingType.qml
new file mode 100644
index 0000000000..765dc91fe1
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/ambiguousBinding/ambiguousContainingType.qml
@@ -0,0 +1,3 @@
+import QtQml 2.15
+
+TestCase {}
diff --git a/tests/auto/qml/qqmllanguage/data/asBroken.qml b/tests/auto/qml/qqmllanguage/data/asBroken.qml
new file mode 100644
index 0000000000..381a012df6
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/asBroken.qml
@@ -0,0 +1,6 @@
+import QtQml
+
+QtObject {
+ id: self
+ property var selfAsBroken: self as Broken
+}
diff --git a/tests/auto/qml/qqmllanguage/data/badGroupedProperty.qml b/tests/auto/qml/qqmllanguage/data/badGroupedProperty.qml
new file mode 100644
index 0000000000..1b8ba61725
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/badGroupedProperty.qml
@@ -0,0 +1,10 @@
+import QtQml
+
+QtObject {
+ id: testItem
+ property rect rect
+ onComplete {
+ rect.x: 2
+ rect.width: 22
+ }
+}
diff --git a/tests/auto/qml/qqmllanguage/data/bindingAliasToComponentUrl.qml b/tests/auto/qml/qqmllanguage/data/bindingAliasToComponentUrl.qml
new file mode 100644
index 0000000000..44fbd03354
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/bindingAliasToComponentUrl.qml
@@ -0,0 +1,10 @@
+import QtQuick
+Item {
+ id: root
+ Component {
+ id: accessibleNormal
+ Item {}
+ }
+ property alias accessibleNormalUrl: accessibleNormal.url
+ property url urlClone: root.accessibleNormalUrl // crashes qml utility
+}
diff --git a/tests/auto/qml/qqmllanguage/data/bindingAliasToComponentUrl2.qml b/tests/auto/qml/qqmllanguage/data/bindingAliasToComponentUrl2.qml
new file mode 100644
index 0000000000..cfdec5e39b
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/bindingAliasToComponentUrl2.qml
@@ -0,0 +1,11 @@
+import QtQuick
+Item {
+ id: root
+ Component {
+ id: accessibleNormal
+ ComponentType {
+ id: inaccessibleNormal
+ }
+ }
+ property alias accessibleNormalProgress: accessibleNormal.progress
+}
diff --git a/tests/auto/qml/qqmllanguage/data/componentMix.qml b/tests/auto/qml/qqmllanguage/data/componentMix.qml
new file mode 100644
index 0000000000..0edc997484
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/componentMix.qml
@@ -0,0 +1,18 @@
+import QtQml
+
+QtObject {
+ component View: QtObject {
+ default property Component delegate
+ }
+
+ component Things : QtObject {
+ property QtObject view: View { delegate: QtObject {} }
+ }
+
+ component Delegated : View {
+ delegate: QtObject {}
+ }
+
+ property Things things: Things {}
+ property Delegated delegated: Delegated {}
+}
diff --git a/tests/auto/qml/qqmllanguage/data/foreignExtended.qml b/tests/auto/qml/qqmllanguage/data/foreignExtended.qml
index 4863e0d567..b01af6d229 100644
--- a/tests/auto/qml/qqmllanguage/data/foreignExtended.qml
+++ b/tests/auto/qml/qqmllanguage/data/foreignExtended.qml
@@ -5,12 +5,17 @@ QtObject {
property Foreign foreign: Foreign {
objectName: "foreign"
}
- property Extended extended: Extended {}
+ property Extended extended: Extended {
+ objectName: "extended"
+ property int changeCount: 0
+ onExtensionChanged: ++changeCount
+ }
property ForeignExtended foreignExtended: ForeignExtended {
objectName: "foreignExtended"
}
property int extendedBase: extended.base
+ property int extendedChangeCount: extended.changeCount
property int extendedInvokable: extended.invokable()
property int extendedSlot: extended.slot()
diff --git a/tests/auto/qml/qqmllanguage/data/fuzzed.1.errors.txt b/tests/auto/qml/qqmllanguage/data/fuzzed.1.errors.txt
index e399799fe9..758be7feae 100644
--- a/tests/auto/qml/qqmllanguage/data/fuzzed.1.errors.txt
+++ b/tests/auto/qml/qqmllanguage/data/fuzzed.1.errors.txt
@@ -1,2 +1 @@
-2:8:Cannot assign to non-existent property "_G"
-
+2:11:Non-existent attached object
diff --git a/tests/auto/qml/qqmllanguage/data/groupFailure.qml b/tests/auto/qml/qqmllanguage/data/groupFailure.qml
new file mode 100644
index 0000000000..e8f8999482
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/groupFailure.qml
@@ -0,0 +1,5 @@
+import QtQml
+
+GroupFailureOuter {
+ b.u: null
+}
diff --git a/tests/auto/qml/qqmllanguage/data/jittedAsCast.qml b/tests/auto/qml/qqmllanguage/data/jittedAsCast.qml
new file mode 100644
index 0000000000..e1798a5d35
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/jittedAsCast.qml
@@ -0,0 +1,15 @@
+import QtQml
+
+QtObject {
+ property QtObject obj: Timer {
+ interval: 1
+ running: true
+ repeat: true
+ onTriggered: {
+ if (++interval === 10)
+ running = false
+ }
+ }
+ property bool running: (obj as Timer).running
+ property int interval: (obj as Timer).interval
+}
diff --git a/tests/auto/qml/qqmllanguage/data/sameNameAliasProperty.qml b/tests/auto/qml/qqmllanguage/data/sameNameAliasProperty.qml
new file mode 100644
index 0000000000..288fd618a6
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/sameNameAliasProperty.qml
@@ -0,0 +1,7 @@
+import QtQml 2.15
+
+QtObject {
+ id: root
+ property int a
+ property alias a: root.a
+}
diff --git a/tests/auto/qml/qqmllanguage/data/sameNamePropertyAlias.qml b/tests/auto/qml/qqmllanguage/data/sameNamePropertyAlias.qml
new file mode 100644
index 0000000000..bb26ba4396
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/sameNamePropertyAlias.qml
@@ -0,0 +1,7 @@
+import QtQml 2.15
+
+QtObject {
+ id: root
+ property alias a: root.a
+ property int a
+}
diff --git a/tests/auto/qml/qqmllanguage/data/signalInlineComponentArg1.qml b/tests/auto/qml/qqmllanguage/data/signalInlineComponentArg1.qml
new file mode 100644
index 0000000000..e20710edd9
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/signalInlineComponentArg1.qml
@@ -0,0 +1,30 @@
+import QtQuick
+
+// this file performs two tests: first, using a signal with a inline component from another file
+// and second, calling the signal from another file using an inline component from another file
+
+Item {
+ signal canYouFeelIt(arg1:SignalInlineComponentArg.Abc)
+
+ property SignalInlineComponentArg.Abc someAbc: SignalInlineComponentArg.Abc {
+ success: "Own signal was called with component from another file"
+ }
+
+ property SignalInlineComponentArg fromAnotherFile: SignalInlineComponentArg {}
+
+ // success of own signal call with parameter from another file
+ property string successFromOwnSignal: "Signal not called yet"
+ // makes it easier to test
+ property string successFromSignalFromFile: fromAnotherFile.success
+
+ Component.onCompleted: {
+ canYouFeelIt(someAbc);
+ fromAnotherFile.someAbc.success = "Signal was called from another file"
+ fromAnotherFile.canYouFeelIt(fromAnotherFile.someAbc)
+ }
+
+ onCanYouFeelIt: (arg) => {
+ successFromOwnSignal = arg.success
+ }
+}
+
diff --git a/tests/auto/qml/qqmllanguage/data/thisInArrow.qml b/tests/auto/qml/qqmllanguage/data/thisInArrow.qml
new file mode 100644
index 0000000000..7dd19782e6
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/thisInArrow.qml
@@ -0,0 +1,39 @@
+import QtQml
+
+QtObject {
+ id: root
+
+ property int width: 43
+ Component.onCompleted: () => { console.log(this.width); }
+
+ property var arrow: () => { return this; }
+ property var func: function() { return this; }
+
+ property QtObject child: QtObject {
+ property var aa;
+ property var ff;
+
+ Component.onCompleted: {
+ root.arrowResult = root.arrow();
+ root.funcResult = root.func();
+
+ var a = root.arrow;
+ root.aResult = a();
+ var f = root.func;
+ root.fResult = f();
+
+ aa = a;
+ root.aaResult = aa();
+
+ ff = f;
+ root.ffResult = ff();
+ }
+ }
+
+ property var arrowResult
+ property var funcResult
+ property var aResult
+ property var fResult
+ property var aaResult
+ property var ffResult
+}
diff --git a/tests/auto/qml/qqmllanguage/data/uncreatableAttached.qml b/tests/auto/qml/qqmllanguage/data/uncreatableAttached.qml
new file mode 100644
index 0000000000..4a861ea075
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/uncreatableAttached.qml
@@ -0,0 +1,8 @@
+import QtQml
+import ABC
+
+QtObject {
+ id: testItem
+ objectName: "00000000000000000000"
+ ItemAttached.attachedName: "111111111"
+}
diff --git a/tests/auto/qml/qqmllanguage/data/variantListConversion.qml b/tests/auto/qml/qqmllanguage/data/variantListConversion.qml
index 334bf17393..19760a64ee 100644
--- a/tests/auto/qml/qqmllanguage/data/variantListConversion.qml
+++ b/tests/auto/qml/qqmllanguage/data/variantListConversion.qml
@@ -1,7 +1,8 @@
import Test
+import QtQml
Foo {
a.a: 12
b.a: 13
- fooProperty: [a, b]
+ fooProperty: [a, b, Component]
}