diff options
Diffstat (limited to 'src/gui/painting/qpaintdevice.h')
-rw-r--r-- | src/gui/painting/qpaintdevice.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gui/painting/qpaintdevice.h b/src/gui/painting/qpaintdevice.h index 4eb972786b..b699956e99 100644 --- a/src/gui/painting/qpaintdevice.h +++ b/src/gui/painting/qpaintdevice.h @@ -58,7 +58,8 @@ public: PdmDpiY, PdmPhysicalDpiX, PdmPhysicalDpiY, - PdmDevicePixelRatio + PdmDevicePixelRatio, + PdmDevicePixelRatioScaled }; virtual ~QPaintDevice(); @@ -76,9 +77,13 @@ public: int physicalDpiX() const { return metric(PdmPhysicalDpiX); } int physicalDpiY() const { return metric(PdmPhysicalDpiY); } int devicePixelRatio() const { return metric(PdmDevicePixelRatio); } + qreal devicePixelRatioF() const { return metric(PdmDevicePixelRatioScaled) / devicePixelRatioFScale; } int colorCount() const { return metric(PdmNumColors); } int depth() const { return metric(PdmDepth); } + // ### Classes that are not QPaintDevice subclasses are implementing metric(), + // ### and need to access this constant. Add it here as a static constant for now + static qreal devicePixelRatioFScale; protected: QPaintDevice() Q_DECL_NOEXCEPT; virtual int metric(PaintDeviceMetric metric) const; @@ -87,7 +92,6 @@ protected: virtual QPainter *sharedPainter() const; ushort painters; // refcount - private: Q_DISABLE_COPY(QPaintDevice) |