From 81a7344e1dea562271865ddf94a7d7138e663ce4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20S=C3=B8rvig?= Date: Mon, 16 Aug 2021 08:41:57 +0200 Subject: Port to QImage and QPixmap deviceIndependentSize() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace the “size() / devicePixelRatio()” pattern with a call to deviceIndependentSize(). Change-Id: I9d9359e80b9e6643e7395028cd43e3261d449ae7 Reviewed-by: Qt CI Bot Reviewed-by: Tor Arne Vestbø --- src/widgets/styles/qwindowsstyle.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/widgets/styles/qwindowsstyle.cpp') diff --git a/src/widgets/styles/qwindowsstyle.cpp b/src/widgets/styles/qwindowsstyle.cpp index 8c5b509eb5..39fabd1218 100644 --- a/src/widgets/styles/qwindowsstyle.cpp +++ b/src/widgets/styles/qwindowsstyle.cpp @@ -1157,9 +1157,7 @@ void QWindowsStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPai pixmap = menuitem->icon.pixmap(proxy()->pixelMetric(PM_SmallIconSize, opt, widget), mode, QIcon::On); else pixmap = menuitem->icon.pixmap(proxy()->pixelMetric(PM_SmallIconSize, opt, widget), mode); - const int pixw = pixmap.width() / pixmap.devicePixelRatio(); - const int pixh = pixmap.height() / pixmap.devicePixelRatio(); - QRect pmr(0, 0, pixw, pixh); + QRect pmr(QPoint(0, 0), pixmap.deviceIndependentSize().toSize()); pmr.moveCenter(vCheckRect.center()); p->setPen(menuitem->palette.text().color()); p->drawPixmap(pmr.topLeft(), pixmap); -- cgit v1.2.3