aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlcomponent/data/complexObjectArgument.qml
blob: 71676a4415edca2db5e7a3fec3d294711c9faf8b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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();
    }
}