Results 1 to 4 of 4

Thread: Q_SCRIPT_DECLARE_QMETAOBJECT(Report, QObject*) construct paramst

  1. #1
    Join Date
    Oct 2009
    Location
    Russia, South Ural, Chelyabinsk
    Posts
    42
    Thanks
    1
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Q_SCRIPT_DECLARE_QMETAOBJECT(Report, QObject*) construct paramst

    Hi!

    I try to use my c++ object in qtScript and I need to create c++ object in QtScript with several arg such as
    var p = new Report("report1",9);
    but Q_SCRIPT_DECLARE_QMETAOBJECT(Report, QObject*) has 1 params....

    Is it possible to construct my own c++ object in qt script with sevral constuctor params&

    Thanks.

  2. #2

    Default Re: Q_SCRIPT_DECLARE_QMETAOBJECT(Report, QObject*) construct paramst

    bump bump
    would love to know this too if even possible or some other kind of workaround

  3. #3
    Join Date
    Feb 2011
    Location
    Bangalore
    Posts
    207
    Thanks
    20
    Thanked 28 Times in 27 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Q_SCRIPT_DECLARE_QMETAOBJECT(Report, QObject*) construct paramst

    Use QScriptable class. Also view the default prototype example.

  4. #4

    Default Re: Q_SCRIPT_DECLARE_QMETAOBJECT(Report, QObject*) construct paramst

    yea i got it now using Q_DECLARE_METATYPE and a constructor function now..
    its just the documentation is kind of confusing

Similar Threads

  1. Replies: 16
    Last Post: 12th December 2014, 20:22
  2. Must construct QApplication before QPaintDevice
    By sekatsim in forum Qt Programming
    Replies: 16
    Last Post: 8th June 2008, 00:00
  3. How to construct a ip contraler?
    By longtrue in forum Qt Programming
    Replies: 1
    Last Post: 7th March 2008, 06:48
  4. Replies: 15
    Last Post: 21st April 2007, 17:46
  5. How to construct Image from Bytes
    By vishal.chauhan in forum Qt Programming
    Replies: 2
    Last Post: 29th January 2007, 05:41

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.