From 5911335756dff5a917e4a7ccf025816c08ddd656 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Tue, 11 Aug 2020 21:11:24 +0200 Subject: Port QtBase to the new QIcon::pixmap() API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The target devicePixelRatio can now be passed to the pixmap() function, instead of a QWindow pointer. This allows us to remove some usage of the QWidget pointer in the styles, since the DPR is accessible from the passed in painter. The QWidget pointer is still used in places where we don't have a painter. Task-number: QTBUG-85885 Change-Id: Ifecc669f5bad655e289a936d71bafe02605f21a4 Reviewed-by: Tor Arne Vestbø --- src/widgets/dialogs/qmessagebox.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/widgets/dialogs') diff --git a/src/widgets/dialogs/qmessagebox.cpp b/src/widgets/dialogs/qmessagebox.cpp index 22d86b301a..4183098274 100644 --- a/src/widgets/dialogs/qmessagebox.cpp +++ b/src/widgets/dialogs/qmessagebox.cpp @@ -2662,10 +2662,8 @@ QPixmap QMessageBoxPrivate::standardIcon(QMessageBox::Icon icon, QMessageBox *mb break; } if (!tmpIcon.isNull()) { - QWindow *window = mb - ? qt_widget_private(mb)->windowHandle(QWidgetPrivate::WindowHandleMode::Closest) - : nullptr; - return tmpIcon.pixmap(window, QSize(iconSize, iconSize)); + qreal dpr = mb ? mb->devicePixelRatio() : qApp->devicePixelRatio(); + return tmpIcon.pixmap(QSize(iconSize, iconSize), dpr); } return QPixmap(); } -- cgit v1.2.3