Results 1 to 4 of 4

Thread: adding subclassed items to a QGraphicsScene

  1. #1
    Join Date
    Oct 2010
    Posts
    11
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default adding subclassed items to a QGraphicsScene

    hi all,

    I have created a subclass from QGraphicsItem, now I'm trying to add instances of this subclass to a QGraphicsScene to be displayed on it. however using the AddItem function in the QGraphicsScene does not work for subclassed items.. any ideas?

  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: adding subclassed items to a QGraphicsScene

    Using addItem works for subclassed items.
    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
    Oct 2010
    Posts
    11
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: adding subclassed items to a QGraphicsScene

    ops sorry it was a pointer issue
    thanks

  4. #4
    Join Date
    Oct 2010
    Location
    Cracow,Bielsko-Biała/Polska
    Posts
    15
    Thanks
    3
    Platforms
    Unix/X11 Windows

    Default Re: adding subclassed items to a QGraphicsScene

    It works for me very well. Maybe, shows some piece of code...

Similar Threads

  1. Adding QGLWidget to QGraphicsScene problem
    By sanjayshelke in forum Qt Programming
    Replies: 10
    Last Post: 26th April 2016, 15:03
  2. Replies: 9
    Last Post: 17th June 2010, 09:53
  3. Adding QGraphicsProxyWidget items into QGraphicsScene
    By yagabey in forum Qt Programming
    Replies: 3
    Last Post: 21st November 2008, 06:33
  4. Adding items to a QGraphicsScene's selection list?
    By mooreaa in forum Qt Programming
    Replies: 2
    Last Post: 1st July 2008, 20:01
  5. adding items in qtablewidget
    By Djony in forum Qt Programming
    Replies: 17
    Last Post: 24th November 2006, 10:03

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.