Hi all,
I am trying to get access to some global objects from a QML WorkerScript, and
whatever I do I cannot seem to access them. The key object is a C++ object
that implements a time consuming function, so I thought this might be the way
to go.
The first attempt was to pass the object as inside the workscript message:
MyQml.qml:
Player {
id: player
}
WorkerScript {
id: workerThread
source: "qrc:player.js"
}
workThread.sendMessage( { object: player } );
This did not work - the message.object is not an object.
The second attempt, declare global variables inside the JavaScript file:
player.js:
var myplayer;
MyQml:
import "player.js" as Player
....
Player.myplayer = player
workThread.sendMessage( {} );
The WorkScript.onMessage function cannot access player.
I am sure that I have missed some crucial piece of documentation somewhere, but
any help solving this issue would help.
Ronan.
_______________________________________________
Qt-qml mailing list
[email protected]
http://lists.qt.nokia.com/mailman/listinfo/qt-qml