Results 1 to 8 of 8

Thread: qtscriptgenerator

  1. #1
    Join Date
    Jul 2008
    Location
    Norway, Trondheim
    Posts
    32
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default qtscriptgenerator

    I can compile the qtscriptgenerator fine, but I am not able to import any of the extensions used.
    I use:
    qApp->addLibraryPath(path_toplugins); //I have added lots of different paths at the same time, the script folder/plugins folder etc. just to be sure
    QScriptEngine *engine = new QScriptEngine(this);
    QString libpaths = qApp->libraryPaths().join("\n");
    qDebug()<<libpaths; //prints the paths I set
    QString exts = engine->availableExtensions().join("\n");
    qDebug()<<exts; // empty!!!!!!!!!!!!!!!!
    QScriptValue tmp = engine->importExtension("qt.core"); // error: unable to import qt.core: no such extension

    I`m using windows xp and Qt 4.6.3, mingw
    Any ideas?

  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: qtscriptgenerator

    Did you copy the extensions to the appropriate place?
    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
    Jul 2008
    Location
    Norway, Trondheim
    Posts
    32
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: qtscriptgenerator

    Quote Originally Posted by wysota View Post
    Did you copy the extensions to the appropriate place?
    Where is the appropriate place?
    I thought it didn`t matter where they were as long as I set
    qApp->addLibraryPath(path_toplugins);
    to the place they are located. I am sure I have set the path to both the folder they are located and to one folder above where they are located, just in case.
    The readme file of qtscripgenerator says:
    "To use the plugins in your application, add the plugins path to the library paths
    (QCoreApplication::setLibraryPaths()), then call QScriptEngine::importExtension()
    (plugin keys are "qt.core", "qt.gui", etc)."

  4. #4
    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: qtscriptgenerator

    Quote Originally Posted by ivareske View Post
    Where is the appropriate place?
    I thought it didn`t matter where they were as long as I set
    qApp->addLibraryPath(path_toplugins);
    Yes, but it depends what you put in "path_toplugins". It should be the directory containing a subdirectory called "script" that contains the extensions. In other words you need to copy the extensions to $QTDIR/plugins/script where $QTDIR stands for your Qt installation directory.
    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.


  5. #5
    Join Date
    Jul 2008
    Location
    Norway, Trondheim
    Posts
    32
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: qtscriptgenerator

    Quote Originally Posted by wysota View Post
    Yes, but it depends what you put in "path_toplugins". It should be the directory containing a subdirectory called "script" that contains the extensions. In other words you need to copy the extensions to $QTDIR/plugins/script where $QTDIR stands for your Qt installation directory.
    I have done that, ensured that they are in a subdirectory with name "script". The files I have in the script folder are:

    libqtscript_cored.a
    libqtscript_guid.a
    libqtscript_networkd.a
    libqtscript_opengld.a
    libqtscript_sqld.a
    libqtscript_svgd.a
    libqtscript_uitoolsd.a
    libqtscript_xmld.a
    libqtscript_xmlpatternsd.a
    qtscript_cored.dll
    qtscript_guid.dll
    qtscript_networkd.dll
    qtscript_opengld.dll
    qtscript_sqld.dll
    qtscript_svgd.dll
    qtscript_uitoolsd.dll
    qtscript_xmld.dll
    qtscript_xmlpatternsd.dll


    Are these maybe debug libraries?
    Could there be an issue with mixing of release/debug libraries?
    My app is compiled with CONFIG += qt release warn_on
    I have compiled qtscriptgenerator as specified in the readme file, maybe I need to change something in the .pro files there to be release

  6. #6
    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: qtscriptgenerator

    Yes, they are debug libraries and will work only in debug mode.
    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.


  7. #7
    Join Date
    Jul 2008
    Location
    Norway, Trondheim
    Posts
    32
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: qtscriptgenerator

    Quote Originally Posted by wysota View Post
    Yes, they are debug libraries and will work only in debug mode.
    Thanks for helping, it worked now! Had to change debug_and_release to release in some .pro files in qtscriptgenerator

  8. #8
    Join Date
    Aug 2012
    Posts
    3
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: qtscriptgenerator

    How to use script generator on android?

    Is it possible?

Tags for this Thread

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.