summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativeworkerscript/data/worker.qml
blob: ca989f894bfc1d660d43c4cdef6710b1e0c50865 (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
import Qt 4.6

WorkerScript {
    id: worker
    source: "script.js"

    property variant response

    signal done()

    function testSend(value) {
        worker.sendMessage(value)
    }

    function compareLiteralResponse(expected) {
        var e = eval('(' + expected + ')')
        return worker.response == e
    }

    onMessage: {
        worker.response = messageObject
        worker.done()
    }
}