summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles
diff options
context:
space:
mode:
authorMorten Johan Sørvig <morten.sorvig@qt.io>2020-09-01 13:45:24 +0200
committerMorten Johan Sørvig <morten.sorvig@qt.io>2020-09-10 17:28:11 +0200
commitb3c991ae8f9da6d8eb26f10b3d4ab08587588c9e (patch)
tree8f2ff32cadf9b8733701b8f99229a6135f53f7d7 /src/widgets/styles
parente1ce78d48498a3de21fe4714e92e2c0fcf1a0813 (diff)
Port from devicePixelRatioF() to devicePixelRatio()
This ports all of QtBase. Change-Id: If6712da44d7749b97b74f4614a04fac360f69d9e Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/widgets/styles')
-rw-r--r--src/widgets/styles/qcommonstyle.cpp2
-rw-r--r--src/widgets/styles/qdrawutil.cpp8
-rw-r--r--src/widgets/styles/qwindowsstyle_p_p.h2
3 files changed, 6 insertions, 6 deletions
diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp
index bf4b383ab7..0ac4077a94 100644
--- a/src/widgets/styles/qcommonstyle.cpp
+++ b/src/widgets/styles/qcommonstyle.cpp
@@ -749,7 +749,7 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q
% QLatin1String(metaObject()->className()), opt, QSize(size, size))
% HexString<uint>(pe);
if (!QPixmapCache::find(pixmapName, &pixmap)) {
- qreal pixelRatio = p->device()->devicePixelRatioF();
+ qreal pixelRatio = p->device()->devicePixelRatio();
int border = qRound(pixelRatio*(size/5));
int sqsize = qRound(pixelRatio*(2*(size/2)));
QImage image(sqsize, sqsize, QImage::Format_ARGB32_Premultiplied);
diff --git a/src/widgets/styles/qdrawutil.cpp b/src/widgets/styles/qdrawutil.cpp
index c19ce5dd89..8c9c5ffae6 100644
--- a/src/widgets/styles/qdrawutil.cpp
+++ b/src/widgets/styles/qdrawutil.cpp
@@ -244,7 +244,7 @@ void qDrawShadeRect(QPainter *p, int x, int y, int w, int h,
}
PainterStateGuard painterGuard(p);
- const qreal devicePixelRatio = p->device()->devicePixelRatioF();
+ const qreal devicePixelRatio = p->device()->devicePixelRatio();
if (!qFuzzyCompare(devicePixelRatio, qreal(1))) {
painterGuard.save();
const qreal inverseScale = qreal(1) / devicePixelRatio;
@@ -358,7 +358,7 @@ void qDrawShadePanel(QPainter *p, int x, int y, int w, int h,
}
PainterStateGuard painterGuard(p);
- const qreal devicePixelRatio = p->device()->devicePixelRatioF();
+ const qreal devicePixelRatio = p->device()->devicePixelRatio();
if (!qFuzzyCompare(devicePixelRatio, qreal(1))) {
painterGuard.save();
const qreal inverseScale = qreal(1) / devicePixelRatio;
@@ -449,7 +449,7 @@ static void qDrawWinShades(QPainter *p,
return;
PainterStateGuard painterGuard(p);
- const qreal devicePixelRatio = p->device()->devicePixelRatioF();
+ const qreal devicePixelRatio = p->device()->devicePixelRatio();
if (!qFuzzyCompare(devicePixelRatio, qreal(1))) {
painterGuard.save();
const qreal inverseScale = qreal(1) / devicePixelRatio;
@@ -591,7 +591,7 @@ void qDrawPlainRect(QPainter *p, int x, int y, int w, int h, const QColor &c,
}
PainterStateGuard painterGuard(p);
- const qreal devicePixelRatio = p->device()->devicePixelRatioF();
+ const qreal devicePixelRatio = p->device()->devicePixelRatio();
if (!qFuzzyCompare(devicePixelRatio, qreal(1))) {
painterGuard.save();
const qreal inverseScale = qreal(1) / devicePixelRatio;
diff --git a/src/widgets/styles/qwindowsstyle_p_p.h b/src/widgets/styles/qwindowsstyle_p_p.h
index a25f5c4166..ee71b3e00a 100644
--- a/src/widgets/styles/qwindowsstyle_p_p.h
+++ b/src/widgets/styles/qwindowsstyle_p_p.h
@@ -72,7 +72,7 @@ public:
static int pixelMetricFromSystemDp(QStyle::PixelMetric pm, const QStyleOption *option = nullptr, const QWidget *widget = nullptr);
static int fixedPixelMetric(QStyle::PixelMetric pm);
static qreal devicePixelRatio(const QWidget *widget = nullptr)
- { return widget ? widget->devicePixelRatioF() : QWindowsStylePrivate::appDevicePixelRatio(); }
+ { return widget ? widget->devicePixelRatio() : QWindowsStylePrivate::appDevicePixelRatio(); }
static qreal nativeMetricScaleFactor(const QWidget *widget = nullptr);
static bool isDarkMode();