Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.9.1
-
Arch Linux
Qt 6.9.1
-
-
46e7060ee (dev), 0cff18f1a (6.10)
Description
Creating a pixmap from a QIcon will sometimes choose the wrong icon file depending on the theme and scale. In this example with the Adwaita theme it chose the 16x16 png instead of the svg, which is much worse for the requested size and scale.
#include <QtWidgets> int main(int argc, char *argv[]) { QApplication app(argc, argv); QIcon::setThemeName("Adwaita"); QIcon icon = QIcon::fromTheme(QStringLiteral("folder-documents")); qDebug() << icon.availableSizes(); // QList(QSize(16, 16), QSize(128, 128)) QPixmap pixmapRegular = icon.pixmap(QSize(128, 128), 1.0); qDebug() << pixmapRegular.size(); // QSize(128, 128): OK QPixmap pixmapScaled = icon.pixmap(QSize(128, 128), 2.0); qDebug() << pixmapScaled.size(); // QSize(16, 16): wrong }
Attachments
Issue Links
- resulted from
-
QTBUG-90634 QIcon not preferring Hi DPI pixmaps when scaling
-
- Closed
-
For Gerrit Dashboard: QTBUG-137700 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
652968,2 | Make sure QIconLoader honors the scalable icon | dev | qt/qtsvg | Status: NEW | 0 | 0 |
652969,4 | QIconLoader: return an exact match for svg icon theme entry | dev | qt/qtbase | Status: MERGED | +2 | 0 |
654869,2 | QIconLoader: return an exact match for svg icon theme entry | 6.10 | qt/qtbase | Status: MERGED | +2 | 0 |
654904,1 | QIconLoader: return an exact match for svg icon theme entry | 6.9 | qt/qtbase | Status: STAGED | +2 | 0 |