Results 1 to 2 of 2

Thread: QtScript and creating non QObject based objects

  1. #1
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default QtScript and creating non QObject based objects

    References:
    http://doc.qt.nokia.com/4.7/scriptin...-based-objects
    http://doc.qt.nokia.com/4.7/object.html

    I need to create several objects that inherit multiple other objects.
    Example:

    Qt Code:
    1. class A: public B, public C
    To copy to clipboard, switch view to plain text mode 

    I can not use QObject based classes (for all these classes) since you can only inherit QObject once for obvious reasons.

    Therefor I need to add non QObject based objects to the script engine.
    The documentation explains how to do that, but it doesn't really explain the availability of the members of this object.

    Are all public members available? I'm very sure they aren't.
    Obviously I can't create a Q_PROPERTY or slot.

    Does anyone have some experience with this? It can save me a couple of days of testing.
    I guess that I need to use setProperty for each and every member I want to make available to the script.


    Edit:
    Never mind: I once again failed to read the documentation correctly.
    The documentation contains, surprise surprise, an example of this.
    Last edited by tbscope; 12th November 2010 at 12:57.

  2. #2

    Default Re: QtScript and creating non QObject based objects

    The documentation explains how to do that, but it doesn't really explain the availability of the members of this object.
    can someone please link me to that? all i can find is qobject based stuff

Similar Threads

  1. Replies: 2
    Last Post: 18th June 2013, 10:31
  2. Use QObject with QtScript
    By Ben1 in forum Newbie
    Replies: 5
    Last Post: 17th August 2010, 10:00
  3. QtScript: Passing an array of objects to C++
    By Plow in forum Qt Programming
    Replies: 0
    Last Post: 16th April 2010, 12:53
  4. Lumina GLSL IDE based on QtScript and dynamic Objects
    By oc2k1 in forum Qt-based Software
    Replies: 0
    Last Post: 12th August 2008, 04:12
  5. Saving properties of a QObject based class
    By ghorwin in forum Qt Programming
    Replies: 1
    Last Post: 15th April 2007, 01:26

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.