summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles
diff options
context:
space:
mode:
authorMorten Johan Sørvig <morten.sorvig@digia.com>2014-05-28 11:21:29 +0200
committerMorten Johan Sørvig <morten.sorvig@digia.com>2015-03-26 10:57:24 +0100
commit3cede847c39269374c52dcf156dc982d7a51f29c (patch)
treebde9cc0eb9c5c445d0c353c7dc7c6f5d816826fa /src/widgets/styles
parent7dd5726380f5d5422edd4b71c6beba6d02b4e3df (diff)
WIP: Add PdmDevicePixelRatioScaled.
Work around QPainDevice::metric's int return type by adding a new metric that returns a scaled devicePixelRatio. Choose a scale factor that gives us more than enough range. The QPainDevice::devicePixelRatio() convenience accessor is public API and can unfortunately not be changed to return a qreal. Add devicePixelRatioF() which returns the (unscaled) devicePixelRatio. Change all call sites of QPainDevice::devicePixelRatio() to use QPainDevice::devicePixelRatioF(). Task-number: QTBUG-38858 Change-Id: Ia97c24e1c7b10241d6425fab2fa513702bb750b8
Diffstat (limited to 'src/widgets/styles')
-rw-r--r--src/widgets/styles/qmacstyle_mac.mm4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm
index 67970ba33d..95a41b4830 100644
--- a/src/widgets/styles/qmacstyle_mac.mm
+++ b/src/widgets/styles/qmacstyle_mac.mm
@@ -1989,7 +1989,7 @@ void QMacStylePrivate::drawColorlessButton(const HIRect &macRect, HIThemeButtonD
}
}
- int devicePixelRatio = p->device()->devicePixelRatio();
+ int devicePixelRatio = p->device()->devicePixelRatioF();
int width = devicePixelRatio * (int(macRect.size.width) + extraWidth);
int height = devicePixelRatio * (int(macRect.size.height) + extraHeight);
@@ -7216,7 +7216,7 @@ CGContextRef qt_mac_cg_context(const QPaintDevice *pdev)
}
CGContextTranslateCTM(ret, 0, pm->height());
- int devicePixelRatio = pdev->devicePixelRatio();
+ qreal devicePixelRatio = pdev->devicePixelRatioF();
CGContextScaleCTM(ret, devicePixelRatio, devicePixelRatio);
CGContextScaleCTM(ret, 1, -1);
return ret;