Details
-
Bug
-
Resolution: Done
-
P2: Important
-
6.0.0
-
None
-
b69b04c4790f319104a1098147cea9405b6e7062 (qt/qtbase/dev) b61275ee72ae2a895dee3652aca886859962cdb2 (qt/qtbase/6.0)
Description
On my Linux/Wayland (reproduces on Windows 10 as well) with DPI scaling set to 200%, QIcon does not automatically use the `@2x` Hi DPI pixmaps.
I have created a simple reproducer to demo the issue. It contains a QListView widget in icon mode with an icon size of 64x64. Attached to the widget is a simple model with the following `data()` method:
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override { if (role == Qt::DisplayRole) return "Hi-dpi repro"; if (role == Qt::DecorationRole) return QIcon(":/icon64.png"); return {}; };
In the resources there are two icons: `icon64.png` which is 64x64 pixels and `icon64@2x.png` which is 128x128 pixels.
I would expect the 128x128 version to be used. Actually the 64x64 version in shown, resulting in poor image quality.
When porting the attached reproducer to Qt5 and enabling `AA_UseHighDpiPixmaps`, the issue disappears. So it seems to me this is a Qt6 regression.