Results 1 to 19 of 19

Thread: QGraphicsItem leaves junk on screen

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2006
    Location
    Germany
    Posts
    84
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    5
    Thanked 5 Times in 3 Posts

    Default Re: QGraphicsItem leaves junk on screen

    Hey,
    I was wondering regarding your attached screenshot - what's that at the left side of your application where it says vertically "Components"? Is this some kind of Sidebar or something? Did you do it on your own or does Qt has something like that? Or do you even have it from somewhere else?
    Just curious

  2. #2
    Join Date
    Aug 2006
    Location
    Bangalore,India
    Posts
    419
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11
    Thanks
    37
    Thanked 53 Times in 40 Posts

    Default Re: QGraphicsItem leaves junk on screen

    Quote Originally Posted by durbrak View Post
    Hey,
    I was wondering regarding your attached screenshot - what's that at the left side of your application where it says vertically "Components"? Is this some kind of Sidebar or something? Did you do it on your own or does Qt has something like that? Or do you even have it from somewhere else?
    Just curious
    Yes, it is a sidebar(more appropriately toolview). I am using krawek's ideality library - an external library which really makes it easy to use.

  3. #3
    Join Date
    Aug 2006
    Location
    Bangalore,India
    Posts
    419
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11
    Thanks
    37
    Thanked 53 Times in 40 Posts

    Default Re: QGraphicsItem leaves junk on screen

    Hi guys,
    Though the wires in my app were moving appropriately the performance was bit low when I tried on my old low end comp. The problem was , one of the lines in wire wasn't being drawn at all when the wires geometry changes rapidly espescially, when lines of wire were perpendicular and lengthy as shown below , where "dash-line" represents undrawn line.
    |
    |
    |
    |
    |_______________________
    The reason I guess is overhead in scene's index management system caused due to repeated "prepareGeometryChange()" calls and also to the fact that the boundingRect coveres unwanted areas resulting in more updates.

    So, I came up with an ugly/good hack by replacing wires with "QRubberBand" of unit width (to represent line) while changing geometry and "QGraphicsLineItem" while static. I hide the QGraphicsLineItem when wire's geometry starts changing and show QRubberBand and vice-versa otherwise . This is working as I expected - fast and clean.
    (I've attached screenshot with QRubberBand "proxying" lines.)

    Do you think this hack is a better alternative or Is there any better way ? Is there any potential problem ?
    Attached Images Attached Images
    Last edited by Gopala Krishna; 30th December 2006 at 18:00. Reason: reformatted to look better

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: QGraphicsItem leaves junk on screen

    Maybe you should turn off BSP indexing while moving objects around? Or if you have composite lines, make them separate objects, so that their bounding rect is much smaller.

Similar Threads

  1. destruction of QGraphicsItem
    By killkolor in forum Qt Programming
    Replies: 2
    Last Post: 5th December 2009, 10:31

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
  •  
Qt is a trademark of The Qt Company.