Results 1 to 10 of 10

Thread: Where is QScriptable in Qt5.2.1

Hybrid View

Previous Post Previous Post   Next Post Next Post
  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 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?

  2. #2
    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.

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

    TorAn (30th April 2014)

  4. #3
    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
  •  
Qt is a trademark of The Qt Company.