-
Qml Context
Hello,
how can I access the qml context for evaluate some javascript expressing.
For example when I want to write a console in which I access some qml object and try to run some methods?
I read on some discussion that I should avoid the using of eval. Is there any reason for that?
What alternatives have I?
-
Re: Qml Context
I think Qt Creator's QML debugging mode has a script console, see http://blog.qt.digia.com/blog/2012/0...2-console-api/
As for eval, I guess there are mainly two reasons:
1) it is risky since it basically executes the given string. So that string either does not contain any user text or file content or it needs to be really well checked and escaped
2) in the case of QML, it could lead to people starting to write imperative code because they are so used to it instead of considering the proper declarative solutions
Cheers,
_
-
Re: Qml Context
Thank you very much.
There is an example in examples/qml/shell.
This kind of stuff is what i am searching for ;o))
See ya