diff options
author | Morten Johan Sørvig <morten.sorvig@qt.io> | 2020-08-11 21:11:24 +0200 |
---|---|---|
committer | Morten Johan Sørvig <morten.sorvig@qt.io> | 2020-08-29 12:42:32 +0200 |
commit | 5911335756dff5a917e4a7ccf025816c08ddd656 (patch) | |
tree | 43e63282bbd8eb455a22eeae1caeb16cbce6fcb0 /src/widgets/dialogs | |
parent | 1719be99a711ff3223779bc90f009c60ece1328c (diff) |
Port QtBase to the new QIcon::pixmap() API
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ø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/widgets/dialogs')
-rw-r--r-- | src/widgets/dialogs/qmessagebox.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
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(); } |