PDA

View Full Version : QGraphicsView inconsisent results when updating different subregions while zoomed in



thomasbecker
13th May 2010, 06:05
I'm using a QGraphicsView to show an image for editing. When a change is made only the section of the scene with a change is updated (using the updateScene routine). It works great when the view is at a 1:1 zoom. When zoomed in a single pixel in the scene is represented by multiple pixels in what the view displays on the screen and that seems to cause it some confusion. Depending on where a partial update occurs some of the pixels displayed on screen will change their mind on which scene pixel they should represent. This means that the boundary between different colors will shift back and forth by one pixel. Not really a huge problem, but it's a little annoying to look at.

Upon further investigation it also works fine when at a zoom of 2, 4, 8 or any time when there is no ambiguity to which underlying pixel should correspond to the pixel on screen.

Anyone know of a way I can make updates of any subregion of a QGraphicsView always produce the same results?