Results 1 to 5 of 5

Thread: Using Qt classes in QtScript

  1. #1
    Join Date
    Dec 2009
    Posts
    128
    Thanks
    7
    Thanked 14 Times in 14 Posts
    Platforms
    Unix/X11 Windows

    Default Using Qt classes in QtScript

    I'm trying to use Qt classes directly in QtScript

    Qt Code:
    1. function Script ()
    2. {
    3. var rect = new QRectF(0,0,10,5) ;
    4. var polygon = new QPolygonF(rect) ;
    5. level.addPolygon(polygon);
    6. }
    7.  
    8. function entry_point()
    9. {
    10. Script() ;
    11. }
    To copy to clipboard, switch view to plain text mode 

    When I evaluate the entry_point() function, this gives me :

    ReferenceError: Can't find variable: QRectF
    Does anybody can tell me what I'm missing (must be obvious) ?
    If I can't use Qt this way, is there a solution ?

  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: Using Qt classes in QtScript

    You need to generate wrappers for Qt classes. There is a tool on Qt Labs to do this.
    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
    Dec 2009
    Posts
    128
    Thanks
    7
    Thanked 14 Times in 14 Posts
    Platforms
    Unix/X11 Windows

    Default Re: Using Qt classes in QtScript

    Thank you for the pointer

    i found that tool, called Qt Script Generator

  4. #4
    Join Date
    Dec 2009
    Posts
    128
    Thanks
    7
    Thanked 14 Times in 14 Posts
    Platforms
    Unix/X11 Windows

    Default Re: Using Qt classes in QtScript

    I'm a bit confused regarding the terms of use of Qt Script Generator.

    In the header files there are 2 sections, one which states that :

    ** No Commercial Usage
    ** This file contains pre-release code and may not be distributed.
    and just below another one which says :

    ** GNU Lesser General Public License Usage
    ** Alternatively, this file may be used under the terms of the GNU Lesser
    ** General Public License version 2.1 as published by the Free Software
    ** Foundation and appearing in the file LICENSE.LGPL
    So, what? Can I use this project or not ? under LGPL or not ?

    For now my application is not commercial, but if one day I want to use Qt Script Generator for a commercial app, will I be allowed to do so ?
    Anybody here used Qt Script Generator in a commercial app ?

  5. #5
    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: Using Qt classes in QtScript

    I think the text says it all.
    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.


Similar Threads

  1. Replies: 2
    Last Post: 18th June 2013, 10:31
  2. construction of classes within classes
    By mobucl in forum Newbie
    Replies: 8
    Last Post: 10th January 2011, 13:51
  3. qtscript
    By wookoon in forum Newbie
    Replies: 4
    Last Post: 4th July 2010, 11:53
  4. Replies: 0
    Last Post: 25th November 2009, 07:46
  5. Please help with QtScript
    By Haccel in forum Qt Programming
    Replies: 0
    Last Post: 16th December 2008, 05:59

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.