diff --git a/src/gui/kernel/qplatformtheme.cpp b/src/gui/kernel/qplatformtheme.cpp index c38ca70eb60..aa530c5f08c 100644 --- a/src/gui/kernel/qplatformtheme.cpp +++ b/src/gui/kernel/qplatformtheme.cpp @@ -470,9 +470,16 @@ const QFont *QPlatformTheme::font(Font type) const return nullptr; } -QPixmap QPlatformTheme::standardPixmap(StandardPixmap sp, const QSizeF &size) const +/*! + \brief Return a pixmap for \a standardPixmap, at the given \a size. + + The implementation should not take system DPR into account, and + always return a pixmap with a DPR of 1. It's up to the consumer + to account for DPR and request a pixmap of the right size. +*/ +QPixmap QPlatformTheme::standardPixmap(StandardPixmap standardPixmap, const QSizeF &size) const { - Q_UNUSED(sp); + Q_UNUSED(standardPixmap); Q_UNUSED(size); // TODO Should return QCommonStyle pixmaps? return QPixmap(); diff --git a/src/plugins/platforms/cocoa/qcocoatheme.mm b/src/plugins/platforms/cocoa/qcocoatheme.mm index 022ef8f072f..6d15e8e5d2c 100644 --- a/src/plugins/platforms/cocoa/qcocoatheme.mm +++ b/src/plugins/platforms/cocoa/qcocoatheme.mm @@ -390,9 +390,7 @@ QPixmap QCocoaTheme::standardPixmap(StandardPixmap sp, const QSizeF &size) const QT_IGNORE_DEPRECATIONS(GetIconRef(kOnSystemDisk, kSystemIconsCreator, iconType, &icon)); if (icon) { - const auto dpr = qGuiApp->devicePixelRatio(); // Highest in the system - pixmap = qt_mac_convert_iconref(icon, size.width() * dpr, size.height() * dpr); - pixmap.setDevicePixelRatio(dpr); + pixmap = qt_mac_convert_iconref(icon, size.width(), size.height()); QT_IGNORE_DEPRECATIONS(ReleaseIconRef(icon)); } diff --git a/tests/manual/iconbrowser/main.cpp b/tests/manual/iconbrowser/main.cpp index c22dcbf7113..11968d86eb7 100644 --- a/tests/manual/iconbrowser/main.cpp +++ b/tests/manual/iconbrowser/main.cpp @@ -413,7 +413,8 @@ public: case Theme: if (row >= themedIcons.size()) break; - return QIcon(QApplicationPrivate::platformTheme()->standardPixmap(QPlatformTheme::StandardPixmap(row), {64, 64})); + return QIcon(QApplicationPrivate::platformTheme()->standardPixmap( + QPlatformTheme::StandardPixmap(row), QSize(64, 64) * qGuiApp->devicePixelRatio())); case Icon: if (row < themedIcons.size()) return QIcon::fromTheme(themedIcons.at(row));