Make QOpenGLWidget work with QT_WIDGETS_HIGHDPI_DOWNSCALE
Get the DPR from QWidget::metric(), which has a code path for handling the QT_WIDGETS_HIGHDPI_DOWNSCALE case. Fixes: QTBUG-111105 Pick-to: 6.5 Change-Id: I821cbdf00423de211719173ae5c0af7b76594f60 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
This commit is contained in:
parent
7367cba9eb
commit
433d67e767
@ -1608,15 +1608,9 @@ int QOpenGLWidget::metric(QPaintDevice::PaintDeviceMetric metric) const
|
|||||||
else
|
else
|
||||||
return qRound(dpmy * 0.0254);
|
return qRound(dpmy * 0.0254);
|
||||||
case PdmDevicePixelRatio:
|
case PdmDevicePixelRatio:
|
||||||
if (window)
|
return QWidget::metric(metric);
|
||||||
return int(window->devicePixelRatio());
|
|
||||||
else
|
|
||||||
return 1.0;
|
|
||||||
case PdmDevicePixelRatioScaled:
|
case PdmDevicePixelRatioScaled:
|
||||||
if (window)
|
return QWidget::metric(metric);
|
||||||
return int(window->devicePixelRatio() * devicePixelRatioFScale());
|
|
||||||
else
|
|
||||||
return int(devicePixelRatioFScale());
|
|
||||||
default:
|
default:
|
||||||
qWarning("QOpenGLWidget::metric(): unknown metric %d", metric);
|
qWarning("QOpenGLWidget::metric(): unknown metric %d", metric);
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user