Results 1 to 15 of 15

Thread: turn off collision detection?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2006
    Location
    Germany
    Posts
    108
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    2
    Thanked 14 Times in 12 Posts

    Default Re: turn off collision detection?

    Quote Originally Posted by Deacon View Post
    Thanks Methedrine, so that gets rid of my boundingRect() calls, but I had discounted this approach because it also kills the repaint function for QGraphicItem objects that I've called .update() on.

    I thought I might be able to apply the scene.invalidate() functions, but I still have to call QGraphicsScene.update() after each to get graphics updates, which ends up calling .boundingRect the same absurd number of times as when ViewportUpdate is on.

    Is there another way to update just a single QRectF when indexing and viewportUpdate are both turned off?

    Thanks,

    Deacon
    Why are you calling update on the QGraphicItems by yourself, if I may ask? What are you trying to achieve? You could certainly create a smaller scene from your already pre-processed QGraphicItems, but to me it currently sounds like you are actually re-inventing QGraphicsView then.
    "If you lie to the compiler, it will get its revenge." - Henry Spencer

  2. #2
    Join Date
    Oct 2008
    Posts
    14
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    3

    Default Re: turn off collision detection?

    Quote Originally Posted by Methedrine View Post
    Why are you calling update on the QGraphicItems by yourself, if I may ask? What are you trying to achieve? You could certainly create a smaller scene from your already pre-processed QGraphicItems, but to me it currently sounds like you are actually re-inventing QGraphicsView then.
    I'm just trying to improve performance by limiting graphical updates to the items, which know when they need updated. When I allow scene.update() to do the job it goes through thousands of .boundingRect() calls, making any dynamic interaction with the screen take at least half of a second. Yes it is definitely reinventing much of QGV but its done already so I guess Ijust have to force paint() calls to make this work.

Similar Threads

  1. 2D Race Car collision detection
    By neonnds in forum Qt Programming
    Replies: 0
    Last Post: 6th July 2008, 08:10
  2. Collision detection QGraphicsItem
    By Blade in forum Qt Programming
    Replies: 5
    Last Post: 5th January 2007, 10:20
  3. Painting and collision detection
    By aamer4yu in forum Qt Programming
    Replies: 1
    Last Post: 18th October 2006, 08:57

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