aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmllanguage/data/objectAndGadgetMethodCallsAcceptThisObject.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qqmllanguage/data/objectAndGadgetMethodCallsAcceptThisObject.qml')
-rw-r--r--tests/auto/qml/qqmllanguage/data/objectAndGadgetMethodCallsAcceptThisObject.qml33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmllanguage/data/objectAndGadgetMethodCallsAcceptThisObject.qml b/tests/auto/qml/qqmllanguage/data/objectAndGadgetMethodCallsAcceptThisObject.qml
new file mode 100644
index 0000000000..2af2e04352
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/objectAndGadgetMethodCallsAcceptThisObject.qml
@@ -0,0 +1,33 @@
+pragma NativeMethodBehavior: AcceptThisObject
+import ValueTypes
+import StaticTest
+import QtQml
+
+QtObject {
+ id: self
+
+ property base v1
+ property derived v2
+
+ property var valueTypeMethod: v1.report
+
+ property var qtMethod: Qt.rect
+
+ property rect badRect: self.qtMethod(1, 2, 3, 4)
+ property rect goodRect1: qtMethod.call(undefined, 1, 2, 3, 4)
+ property rect goodRect2: qtMethod.call(Qt, 1, 2, 3, 4)
+
+ property string badString: self.valueTypeMethod()
+ property string goodString1: valueTypeMethod.call(undefined)
+ property string goodString2: valueTypeMethod.call(v1)
+ property string goodString3: valueTypeMethod.call(v2)
+
+ property string goodString4: toString.call(Qt)
+ property string badString2: toString.call(goodRect1)
+
+ property var mm: OriginalSingleton.mm
+ property int badInt: self.mm()
+ property int goodInt1: mm.call(undefined)
+ property int goodInt2: mm.call(OriginalSingleton)
+ property int goodInt3: mm.call(DerivedSingleton)
+}