Results 1 to 6 of 6

Thread: QGraphicsItem or QGraphicsProxyWidget?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2009
    Posts
    47
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QGraphicsItem or QGraphicsProxyWidget?

    Great, that works. I decided to subclass QGraphicsTextItem to include the draw of its boundary, eliminating the need for the QGraphicsRectItem *rect. So the ports are children of my custom text, but how am I going to be able to query how many ports a given custom text item has?

    Should I make the ports as member variable of my custom text? If so, will I need to override the paint method to draw the ports (of type QGraphicsEllipseItem or QGraphicsRectItem). Thanks.

  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: QGraphicsItem or QGraphicsProxyWidget?

    Quote Originally Posted by ttvo View Post
    Great, that works. I decided to subclass QGraphicsTextItem to include the draw of its boundary, eliminating the need for the QGraphicsRectItem *rect. So the ports are children of my custom text, but how am I going to be able to query how many ports a given custom text item has?
    You need to provide some API for this in your subclass.

    Should I make the ports as member variable of my custom text? If so, will I need to override the paint method to draw the ports (of type QGraphicsEllipseItem or QGraphicsRectItem). Thanks.
    Why does informing one object about a state of another object require reimplementing its drawing routines?
    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.


Similar Threads

  1. Replies: 2
    Last Post: 25th March 2011, 09:18
  2. destruction of QGraphicsItem
    By killkolor in forum Qt Programming
    Replies: 2
    Last Post: 5th December 2009, 10:31
  3. Replies: 11
    Last Post: 2nd July 2009, 00:41
  4. Replies: 1
    Last Post: 25th February 2009, 00:34
  5. Multiple Inheritance for QGraphicsItem
    By pankaj.patil in forum Qt Programming
    Replies: 2
    Last Post: 1st July 2008, 14:49

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.