Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8121169
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T05:23:54+00:00 2026-06-06T05:23:54+00:00

I’ve got an application where you can watch replays for a given 2D game

  • 0

I’ve got an application where you can watch replays for a given 2D game :

Basically, a vehicle is moving on a map. The view is centered on vehicle so the map is scrolling as replay is playing, something Micro Machines-like (it’s just to give an idea, the actual game is not Micro Machines).


(source: randomracket.com)

In my scene, the map is static while the vehicle is moving around. The view is scrolling for each frame of the replay, so that vehicle is centered.
For performance reason, the map is tiled in several QGraphicsPixmapItems.

Viewport update mode is set to QGraphicsView::BoundingRectViewportUpdate.
Items index method is set to QGraphicsScene::NoIndex.

In most cases, all is working fine. But when the map is larger than usual, the vehicle is not updated. The view is scrolling and tiles are well updated; but not the vehicle, unless I trigger a full viewport update by zooming in/out (so I know the item is well positioned).

The vehicle’s boundingRect is set once for ever, and is valid (see below, given in logical coordinates). I do not paint outside item’s bounding rect.

some example of debug output (only third configuration does not work) :

ok :
vehicle->boundingRect() : QRectF(-1.9391,-1.9391 3.8782x3.8782)
scene->sceneRect() : QRectF(-117.543,-38.3826 138.834x40.3217)
SCENE_CACHING : 85 tiles

ok :
vehicle->boundingRect() : QRectF(-2.88489,-2.88489 5.76979x5.76979)
scene->sceneRect() : QRectF(-68.8843,-18.2202 187.989x119.277)
SCENE_CACHING : 308 tiles

nok : vehicle won't update
vehicle->boundingRect() : QRectF(-3.45546,-3.45546 6.91092x6.91092)
scene->sceneRect() : QRectF(-64.2988,-107.802 188.927x187.445)
SCENE_CACHING : 506 tiles

I tried to debug an update pass, and the paint event indeed excludes the region where vehicle is…

Anyone know why an update could miss a particular item ?

Edit :

Qt : 4.8.1, and i’ve seen the problem with previous versions as well

OS : Windows XP SP3, did not test on other OS yet

I did not succeed in reproducing the problem with a minimal example. The minimal example just work like it is expected to do. In real life, here is what is done :

  1. The map is read from a file. It’s composed of up to hundreds of polygons delimiting ground/sky (each one of which is graphically made of polygons, edges and vertices layers), thousands of pictures and textures which are then clipped to ground or sky, and some other items.

  2. I compute all the clippings, and then render the scene in a QImage. The image is tiled in several QGraphicsPixmapItems added to the scene, while the former items are removed from scene and deleted (btw the bug also occured when I didn’t remove&delete former items).

  3. The replay is launched

I think Qt Graphics internals are messed up, but I can’t figure out how to clean/reset it.

Here is an example of graphics (to illustrate what I mean by ground/sky). The map can be quite huge.


(source: kopasite.net)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T05:23:56+00:00Added an answer on June 6, 2026 at 5:23 am

    Picking up my comment from above as an answer:

    You need to use QGraphicsScene::invalidate(...) to invalidate the parts of the scene that should be redrawn.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a jquery bug and I've been looking for hours now, I can't
Basically, what I'm trying to create is a page of div tags, each has
I've got a string that has curly quotes in it. I'd like to replace
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
i got an object with contents of html markup in it, for example: string
Does anyone know how can I replace this 2 symbol below from the string
I have an MVC Razor view @{ ViewBag.Title = Index; var c = (char)146;
Thanks in advance for your help. I have a need within an application to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.