Results 1 to 2 of 2

Thread: Resizing QGraphicsItem

  1. #1
    Join Date
    Jan 2007
    Posts
    2
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Default Resizing QGraphicsItem

    Resizing a QGraphicsItem seems to cause trouble when it is displayed on a QGraphicsView. It causes some nasty artifacts, here's a screenshot:


    It looks like Qt is clearing the area in the bounding rectangle of the item right before a paint. Unfortunately, if the bounding rectangle has changed since the last paint, not all the area in the old bounding rectangle gets cleared. Does anyone know a way around this?

  2. #2
    Join Date
    Jan 2006
    Location
    Russia
    Posts
    16
    Thanked 5 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Resizing QGraphicsItem

    you need to call prepareGeometryChange() to tell qt that your element is going to change itself.

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

    philentropist (17th January 2007)

Similar Threads

  1. destruction of QGraphicsItem
    By killkolor in forum Qt Programming
    Replies: 2
    Last Post: 5th December 2009, 10:31
  2. Collision detection QGraphicsItem
    By Blade in forum Qt Programming
    Replies: 5
    Last Post: 5th January 2007, 10:20
  3. QGraphicsItem and signals
    By aamer4yu in forum Qt Programming
    Replies: 3
    Last Post: 27th December 2006, 11:19
  4. Rotating QGraphicsItem
    By Gopala Krishna in forum Qt Programming
    Replies: 3
    Last Post: 21st December 2006, 11:50

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.