Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.15.2
-
None
-
Intel(R) Xeon(R) W-2223 CPU @ 3.60GHz 3.60 GHz
32.0 Go
NVidia Quadro P2200
Windows 10 Pro
19042.746
Description
Using a QGraphicsView to render two QPixmaps of the same size, one as a background and the other, semi-transparent with some pixels painted opaque used as an overlay.
When scaling the view, the pixmaps appear mis-aligned at specific scales but not at others.
The issue is not present when setting a QGLWidget or QOpenGLWidget as the viewport.
// Example code that produce the issue QGraphicsScene* scene = new QGraphicsScene(); setScene(scene); // Load background image of size(320,240) QPixmap* backgroundLayer = new QPixmap("C:\\path_to_image_file\\22-02-2022_16h13m03s.png"); scene->addPixmap(*backgroundLayer); badPixelsLayer = new QPixmap(backgroundLayer->size()); badPixelsLayer->fill(Qt::transparent); // Paint some pixels on this pixmap scenePixmapItem = scene->addPixmap(*badPixelsLayer); float scaleFactor = 86.7362; scale(scaleFactor, scaleFactor);
Below is the scaled view of the two pixmaps, the squares are the images' pixels. Background is in grayscale, overlay transparent with red pixels.