Results 1 to 10 of 10

Thread: Where is QScriptable in Qt5.2.1

  1. #1
    Join Date
    Nov 2009
    Location
    US, Midwest
    Posts
    215
    Thanks
    62
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Where is QScriptable in Qt5.2.1

    I am porting an old project from qt4.7.3 to qt5.2.1 (windows). Compiler complains that it can't find any of the QtScript* includes

    Qt Code:
    1. #include <QScriptable>
    2. #include <QStringList>
    3. #include <QScriptContext>
    4. #include <QScriptEngine>
    5. #include <QScriptValue>
    6. #include <QScriptTools>
    To copy to clipboard, switch view to plain text mode 

    quick review of the source tree under qtbase\include shows that under QtScript folder there is a single file, QtScriptDepends, and not QScript. Same with QtScriptTools folder.

    What is going on? Where are script includes now? Any help will be greatly appreciated.

    Thanks.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Where is QScriptable in Qt5.2.1

    Hmm, how did you install Qt?

    Built from sources? If so have you built and installed the qtscript module?

    Cheers,
    _

  3. #3
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Where is QScriptable in Qt5.2.1

    I have found that, on Windows with MSVC builds, many of the modules beyond the standard core are not built using the recommended configure / nmake steps. The unfortunate thing is because "nmake install" is totally broken, even after you build the extra modules manually getting them installed correctly is a real pain.

    Note for those who keep their heads buried firmly in the Qt sandbox: Qt Creator / qmake / jom aren't the solution for a lot of us and it is sad that the Qt-Project folks won't accept that and put more effort into getting nmake builds fixed.
    Last edited by d_stranz; 1st March 2014 at 16:23.

  4. #4
    Join Date
    Nov 2009
    Location
    US, Midwest
    Posts
    215
    Thanks
    62
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Where is QScriptable in Qt5.2.1

    Thanks for the replies! No, I did not built it separately, never had to do it .
    Do you know where I can find the instructions of how to build it on windows?

    Thanks

  5. #5
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Where is QScriptable in Qt5.2.1

    Hmm. I thought you were building yourself since you wrote you had looked into a source folder (qtbase\include)

    So you installed using one of the pre-built installers?

    Have you checked in the install path?

    Does your .pro file contain "script" in the QT line?

    Cheers,
    _

  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: Where is QScriptable in Qt5.2.1

    How is your problem related to this thread?
    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
    Nov 2009
    Location
    US, Midwest
    Posts
    215
    Thanks
    62
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Where is QScriptable in Qt5.2.1

    Sorry, I asked question first and looked in the source tree second .

    Then I compiled qtscript. No more issues with it, sorry. And thanks for the help and quick responses!

  8. #8
    Join Date
    Nov 2009
    Location
    US, Midwest
    Posts
    215
    Thanks
    62
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Where is QScriptable in Qt5.2.1

    This problem with QtScript is following me around .

    I had to rebuild Qt5.2.1 from sources. My Qt sources are installed in c:\Libraries\Qt\Qt5.2.1 Next, I rebuilt qtScript (located in c:\Libraries\Qt\Qt5.2.1\qtscript\qtscript.pro. And now my project that used to compile with qtscript includes is giving me compilation errors (can't find qtscript header files).

    My question is:
    The include paths in my project settings are $(QTDIR)\include\QtScript and $(QTDIR)\include\QtScriptTools, where $(QTDIR) is c:\Libraries\Qt\Qt5.2.1\qtbase.
    But the qtscript.pro builds all includes in c:\Libraries\Qt\Qt5.2.1\qtscript\include. Changing include paths in my project to point to c:\Libraries\Qt\Qt5.2.1\qtscript\include does not help, i.e compiler does not find other qscript-dependent header.

    What are the right steps to build qtscript in Qt5.2.1 and which includes to use in the project?

  9. #9
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Where is QScriptable in Qt5.2.1

    The Qt scripting support is shipped as a standard part of the official Qt5 binaries.
    A default build from a source tar ball should have built the qtscript module.

    Once you have a Qt5 with the scripting module then you enable it on your project file with:
    Qt Code:
    1. QT += script
    To copy to clipboard, switch view to plain text mode 
    This is documented at the top of QT 5 class documentation pages such as QScriptable. No other manual INCLUDEPATH or LIBS settings are required.
    Last edited by ChrisW67; 30th April 2014 at 07:56.

  10. The following user says thank you to ChrisW67 for this useful post:

    TorAn (30th April 2014)

  11. #10
    Join Date
    Nov 2009
    Location
    US, Midwest
    Posts
    215
    Thanks
    62
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Where is QScriptable in Qt5.2.1

    Thank you. Since for this particular project I am using vs2013 I neglected to try to compile test project in QtCreator. Indeed, it compiles just fine. Looking into the list of includes in compile output I realized what the problem was. QtScript is included from four places, and when I added paths to VS that mimics the one in Qt everything worked.
    c:\Libraries\Qt\Qt5.2.1\qtscript\include
    c:\Libraries\Qt\Qt5.2.1\qtscript\include\QtScript
    $(QTDIR)\include\QtScript

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.