Results 1 to 2 of 2

Thread: Help on QGraphicsItem::paint please

  1. #1
    Join Date
    Dec 2006
    Thanked 18 Times in 17 Posts
    Qt products

    Default Help on QGraphicsItem::paint please


    My QGraphicsScene has a scroll bar. When I scroll it, the QGraphicsItem:aint option's exposedRect is always fixed to the viewport's size, I have to redraw the entire item even though most of the item has not changed.

    What I hope is to only redraw the exposed part of the item when scroll bar is moved, because it takes a lot of time to draw the item.

    I have used
    QGraphicsView::setViewportUpdateMode( QGraphicsView::MinimalViewportUpdate );

    Any suggestions please?

  2. #2
    Join Date
    Jan 2011
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Unix/X11 Windows Maemo/MeeGo

    Default Re: Help on QGraphicsItem::paint please

    Have you set the QGraphicsItem Flag:

    Qt Code:
    1. setFlag(QGraphicsItem::ItemUsesExtendedStyleOption);
    To copy to clipboard, switch view to plain text mode 

    It's mentioned in the doc that the exposedRect member depend on it

  3. The following user says thank you to mitch for this useful post:

    lni (3rd May 2012)

Similar Threads

  1. QGraphicsItem paint not triggered
    By roband915 in forum Qt Programming
    Replies: 9
    Last Post: 31st March 2011, 11:06
  2. Replies: 4
    Last Post: 30th August 2010, 15:37
  3. OpenGL functions in QGraphicsItem::paint
    By Lendrick in forum Qt Programming
    Replies: 1
    Last Post: 21st June 2010, 18:30
  4. Qgraphicsitem parent/child paint problem.
    By repka3 in forum Qt Programming
    Replies: 1
    Last Post: 24th July 2009, 23:03
  5. Paint QGraphicsItem problem
    By dreamer in forum Qt Programming
    Replies: 3
    Last Post: 23rd June 2008, 19:18


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.