diff options
Diffstat (limited to 'tests/auto/qml/qqmlcomponent/data/complexObjectArgument.qml')
-rw-r--r-- | tests/auto/qml/qqmlcomponent/data/complexObjectArgument.qml | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlcomponent/data/complexObjectArgument.qml b/tests/auto/qml/qqmlcomponent/data/complexObjectArgument.qml new file mode 100644 index 0000000000..71676a4415 --- /dev/null +++ b/tests/auto/qml/qqmlcomponent/data/complexObjectArgument.qml @@ -0,0 +1,28 @@ +import QtQml 2.15 + +QtObject { + id: root + Component.onCompleted: { + function WithPrototype(refMsgSeqNr) { + this.init(refMsgSeqNr) + }; + + WithPrototype.prototype = { + init: function(refMsgSeqNr) { + this.testObj = { + has: function(a) { return a === refMsgSeqNr } + } + + this.protocolSubTypeID = 2 + this.messageControl = 0 + this.referredMsgSequenceNumber = refMsgSeqNr + } + }; + + let comp = Qt.createComponent("dynamic.qml"); + let inst1 = comp.createObject(root, { testObj: new Set(), }); + let inst2 = comp.createObject(root, new WithPrototype(1)); + + objectName = inst1.use() + " - " + inst2.use(); + } +} |