Results 1 to 3 of 3

Thread: QtScript: Using scripts as uncompiled resources

  1. #1
    Join Date
    Jan 2011
    Posts
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default QtScript: Using scripts as uncompiled resources

    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!
    Last edited by qtgolf; 25th January 2011 at 16:18.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QtScript: Using scripts as uncompiled resources

    Quote Originally Posted by qtgolf View Post
    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.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Jan 2011
    Posts
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QtScript: Using scripts as uncompiled resources

    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!

Similar Threads

  1. Execute Python Scripts from QT C++?
    By Muhammad.Ammar in forum Newbie
    Replies: 1
    Last Post: 4th March 2009, 22:14
  2. Executing SQL scripts from a file
    By William Wilson in forum Qt Programming
    Replies: 2
    Last Post: 30th August 2007, 19:28
  3. How to run shell scripts ?
    By npc in forum Qt Programming
    Replies: 5
    Last Post: 22nd May 2006, 11:59
  4. QSA scripts: how to wait for events?
    By olberg in forum Qt Programming
    Replies: 2
    Last Post: 17th May 2006, 14:56
  5. QSA: loading scripts at runtime
    By seneca in forum Qt Programming
    Replies: 0
    Last Post: 15th February 2006, 15:19

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.