PDA

View Full Version : QtScript: Using scripts as uncompiled resources



qtgolf
25th January 2011, 16:09
Hi

I am new to the forum and have a question regarding QtScript, specifically .js script files. The examples I have seen all include the xyz.js file in the qrc file. So the script is a resource which is compiled into the binary. But what if you want the script to be able to change without having to recompile the application? Is there a way to do that?

I am hoping I could add/remove scripts to/from a /scripts directory and my application would recogize them and behave accordingly. Is this possible with QtScript?

Thanks in advance for your help!

wysota
25th January 2011, 16:29
But what if you want the script to be able to change without having to recompile the application? Is there a way to do that?
Then use a file path that is not inside the resource. QtScript can execute anything that you can load into QString.

qtgolf
25th January 2011, 17:28
That was easy :)
Basically I was just incorrectly assuming that a script must be specified in the qrc file to be used.
Thanks for your help again!