PDA

View Full Version : Replacing QtScript with QML



inpoculis789
19th July 2010, 13:59
Hello,

I would like to replace QtScript with QML because C++ object binding seems far simpler.

However I have a problem, how can I create new objects inside a 'script:{...}'?
To illustrate the problem, here is a copy/paste of the examples/declarative/text/fonts/hello.qml:


ScriptAction {
script: {
container.y = (screen.height / 4) + (Math.random() * screen.height / 2)
container.x = (screen.width / 4) + (Math.random() * screen.width / 2)
}
}

How could we add something like: var myrect=new MyRect(); ?

Regards,

Bernard