I was just looking over your last 2 posts...
Good you found a solution...
BTW:
setSceneRect( item->boundingRect( )) did not work because boundingRect remains unscaled. It always remains at the original value. That is why the mapping is needed.
Another thing to remember is that when you create the raster it is placed in the scene at position (0,0).
When you scale it, it will shrink, but the top left position is still at (0, 0), that is why the center would not work. I thought that is what you wanted - to see the entire scaled picture, not to see it AND be centered.
Your solution, set scene rect will shrink the scene size, but I guess that's ok, because you'll set it again if you zoom in/out...
Regards


.
Reply With Quote
Bookmarks