Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
None
-
6.5.0
-
None
-
win11
Description
Normally, if I set the default transform[(1,0,0),(0,1,0),(0,0,1)] for QPainter, the image should be drawn without any changes, and it should fill the entire control. However, I found that this is not the case on high-DPI.
class QImageViewer : public QQuickPaintedItem { ... private: virtual void paint(QPainter* painter) override; QTransform param_matrixWorld; ... } void QImageViewer::paint(QPainter* painter) { painter->setWorldTransform(param_matrixWorld); qDebug()<<param_matrixWorld; if (image2Draw.width() > 0 && image2Draw.height() > 0) { painter->drawImage(QRect(0, 0, width(), height()), image2Draw, QRect(0, 0, image2Draw.width(), image2Draw.height())); } //Now disable matrixWorld for overlay display painter->setWorldMatrixEnabled(false); }