Results 1 to 5 of 5

Thread: making QGraphicsItemGroup inherit from QObject

Threaded View

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

    Default making QGraphicsItemGroup inherit from QObject

    For some reason QGraphicsItemGroup doesn't inherit from QObject. It creates special handling for this class objects, when making these objects scriptable and has become a nuisance for me . I would like to subclass QGraphicsItemGroup so that it inherits from QObject and QGraphicsItemGroup. However that is easier said than done when looking at the implementation of QGraphicsObject ;( .
    So I have two ways
    1. Subclass QGraphicsItemGroup to inherit from QObject and QGraphicsItemGroup and re-implement along the lines as is done in QGrapicsObject
    2. Forget about QGraphicsItemGroup, Subclass from QGraphicsObject and re-implement all the functionality of QGraphicsItemGroup so that the class behaves like QGraphicsItemGroup but is also a Qobject.
    Which is the easier way. And how do I go ahead about it?

  2. The following 2 users say thank you to pkj for this useful post:


Similar Threads

  1. QGraphicsItem doesn't inherit QObject?
    By xyzt in forum Qt Programming
    Replies: 6
    Last Post: 26th September 2011, 14:59
  2. About inherit
    By nesson in forum Qt Programming
    Replies: 1
    Last Post: 8th February 2011, 13:07
  3. QTreeWidgetItem does not inherit QObject
    By johnmauer in forum Qt Programming
    Replies: 2
    Last Post: 20th January 2010, 15:35
  4. Making them all QObject's - good or bad practive?
    By andre in forum Qt Programming
    Replies: 3
    Last Post: 2nd November 2009, 19:00
  5. Inherit from QObject for data-classes?
    By niko in forum Qt Programming
    Replies: 7
    Last Post: 14th July 2007, 15:09

Tags for this Thread

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.