Make QPaintDevice::devicePixelRatio() return qreal

For historical reasons Qt 5 has:

  int QPaintDevice::devicePixelRatio()
  qreal QPaintDevice::devicePixelRatioF()

Change the int to qreal so that Qt 6 will have

  qreal QPaintDevice::devicePixelRatio()
  qreal QPaintDevice::devicePixelRatioF() [to-be-removed]

Change-Id: Ie904e02ec490cbcd2acb5dcecb193e9af4cb90f0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
Morten Johan Sørvig 2020-08-06 17:39:13 +02:00 committed by Tor Arne Vestbø
parent 4073d3a10e
commit fded035b1c
2 changed files with 4 additions and 4 deletions

View File

@ -83,8 +83,8 @@ public:
int logicalDpiY() const { return metric(PdmDpiY); }
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(); }
qreal devicePixelRatio() const { return metric(PdmDevicePixelRatioScaled) / devicePixelRatioFScale(); }
qreal devicePixelRatioF() const { return devicePixelRatio(); }
int colorCount() const { return metric(PdmNumColors); }
int depth() const { return metric(PdmDepth); }

View File

@ -123,7 +123,7 @@
The constant scaling factor used is devicePixelRatioFScale(). This enum value
has been introduced in Qt 5.6.
\sa metric(), devicePixelRatioF()
\sa metric(), devicePixelRatio()
*/
/*!
@ -284,7 +284,7 @@
*/
/*!
\fn int QPaintDevice::devicePixelRatio() const
\fn qreal QPaintDevice::devicePixelRatio() const
Returns the device pixel ratio for device.