Results 1 to 3 of 3

Thread: Garbled marks when moving items in QGraphicsScene

  1. #1
    Join Date
    Dec 2010
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Garbled marks when moving items in QGraphicsScene

    I have a class which inherits from QGraphicsScene. I use it to display diagrams (inheriting from QGraphicsPolygonItem) and arrows joining the diagrams (inheriting from QGraphicsLineItem). When I move the diagrams, the arrows leave some garbled marks. What should I do? Is there some better, proper word to name the phenomenon?

    I attach a photo portraying nature of the problem.
    Attached Images Attached Images

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Garbled marks when moving items in QGraphicsScene

    this is most likely caused when you do custom painting and do not exactly respect the bounding rect of the item. Make sure you don't paint outside the bounding rect and "play" with the scenes update mode.

  3. #3
    Join Date
    Aug 2009
    Location
    Belgium
    Posts
    310
    Thanks
    10
    Thanked 31 Times in 25 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Garbled marks when moving items in QGraphicsScene

    Hi,

    I have a similar problem when using the standard graphicsview items (QGraphicsTextItem) and when their size changes. There is a prepareGeometryChange() method that I think may be related, but haven't figured it out quite yet.

    Best regards,
    Marc

Similar Threads

  1. Replies: 8
    Last Post: 7th November 2012, 19:20
  2. Moving QGraphicsScene to Left or Right firections
    By augusbas in forum Qt Programming
    Replies: 2
    Last Post: 30th June 2010, 04:45
  3. Moving the QGraphicsScene background content
    By maverick_pol in forum Qt Programming
    Replies: 5
    Last Post: 16th May 2008, 07:37
  4. Moving items between two views.
    By YuriyRusinov in forum Qt Programming
    Replies: 11
    Last Post: 2nd April 2007, 13:53
  5. Moving an item in QGraphicsScene
    By prosass in forum Newbie
    Replies: 4
    Last Post: 28th March 2007, 14:21

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.