Skip to content

Use a simple QGraphicsPixmapItem for drawing raster images

Arjen Hiemstra requested to merge work/ahiemstra/pixmapitem into master

RasterImageView was using a custom implementation that would use two QPixmaps to do double buffered rendering. However, since Qt already renders things double buffered, we are doing duplicate work. So drop that and just use QGraphicsPixmapItem so we rely on Qt to handle optimisations. This removes a lot of error-prone and difficult to follow custom code.

BUG: 271671

Additionally, we can move the background painting to a custom QGraphicsItem which allows us to avoid duplicating the background painting between the different views.

Also cleanup the JPEG version detection code since that broke while I was working on it and there is a better solution now.

Edited by Arjen Hiemstra

Merge request reports