Results 1 to 3 of 3

Thread: Reflection on Qt

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2011
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Reflection on Qt

    Hi everybody, I would use Reflection on Qt, but I do not know how I can do that. In Java, any object can be instantiated and be called even if unknown. In Qt, I can only do this when I know that this object. Has anyone used Reflection in Qt?

    My Object:

    Qt Code:
    1. class Obj : public QObject
    2. {
    3. Q_OBJECT
    4.  
    5. public:
    6. Q_INVOKABLE Obj(QObject *parent = 0);
    7. Q_INVOKABLE virtual ~Obj();
    8.  
    9. Q_INVOKABLE virtual QVariant execute (QList<QVariant> &);
    10. Q_INVOKABLE uint getKey();
    11. };
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Reflection on Qt

    QMetaObject provides this functionality, you can use it to browse properties and methods of Qt Objects.

    http://doc.qt.nokia.com/latest/qmetaobject.html

Similar Threads

  1. QxOrm : Persistence (ORM), Serialization, Reflection
    By QxOrm in forum Qt-based Software
    Replies: 19
    Last Post: 27th January 2014, 04:36
  2. How to make the "Reflection" effect by QML?
    By charlse in forum Qt Programming
    Replies: 0
    Last Post: 7th April 2010, 13:04
  3. java reflection
    By mickey in forum General Programming
    Replies: 1
    Last Post: 24th July 2008, 21:17
  4. Making a reflection of a picture
    By desch in forum Qt Programming
    Replies: 2
    Last Post: 17th February 2008, 18:38
  5. reflection and qmetaobject
    By KShots in forum Qt Programming
    Replies: 8
    Last Post: 16th May 2007, 20:53

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.