Results 1 to 2 of 2

Thread: How to make a graphic item paint itself AND its children ?

  1. #1
    Join Date
    Jan 2014
    Posts
    1
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default How to make a graphic item paint itself AND its children ?

    Hello,
    I was wondering if there was a way to make the paint method of the QGraphicsItem ( virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0) ) also paint all the children of the item ?

    This would correspond to the behavior of the QGraphicsView::render method, but for the QGraphicsItem…

    Thank you in advance for your answers !

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to make a graphic item paint itself AND its children ?

    I am not sure what your goal is but doesn't QGraphicsView already take care of painting all items that are visible within its boundaries, including children?

    Cheers,
    _

Similar Threads

  1. Best practice to implement a graphic item
    By Jon Heron in forum Newbie
    Replies: 1
    Last Post: 4th December 2010, 22:20
  2. Replies: 0
    Last Post: 6th November 2009, 21:59
  3. Replies: 2
    Last Post: 19th August 2008, 09:46
  4. how to paint 3d graphic(like pie without OPenGL module)
    By catherine_98 in forum Qt Programming
    Replies: 1
    Last Post: 28th June 2007, 19:42
  5. Replies: 1
    Last Post: 18th July 2006, 10:53

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.