@Kaj-Gronholm Thank you for clarifying.
It seems to me that the rest of the QCanvasPainter does take devicePixelRatio into account. If you call the QCanvasRhiPaintDriver::beginPaint method that takes logicalSize and dpr parameters, the painter will automatically scale points and line widths, so that the drawing looks the same across different dpr screens. I have confirmed this with testing.
The main difference in behavior I would expect is for QCanvasPainter::drawImage(const QCanvasImage &image, float x, float y) to draw the image based on the logical dimensions (dimensions / image_dpr). So, if I've created a QCanvasImage from a QImage with dpr=2, these should be equivalent:
painter->drawImage(retinaImg, x, y);
painter->drawImage(retinaImg, x, y, retinaImg.width() / 2, retinaImg.height() / 2);
Or, put another way, if I had a @1px image and painted it with
painter->drawImage(img, x, y),
and then replaced it with a @2px or @3px image, I would expect it to take the same amount of logical space on the screen.