From b3c991ae8f9da6d8eb26f10b3d4ab08587588c9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Tue, 1 Sep 2020 13:45:24 +0200 Subject: Port from devicePixelRatioF() to devicePixelRatio() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This ports all of QtBase. Change-Id: If6712da44d7749b97b74f4614a04fac360f69d9e Reviewed-by: Tor Arne Vestbø --- src/widgets/styles/qcommonstyle.cpp | 2 +- src/widgets/styles/qdrawutil.cpp | 8 ++++---- src/widgets/styles/qwindowsstyle_p_p.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/widgets/styles') 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(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(); -- cgit v1.2.3