Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
QIcon Hi DPI (retina) from QPixMap
QIcondoc suggests using files to create Hi DPI icons. but if that's not possible, because you programmatically create
QPixMaps, or because your existing subsystem uses
QPixMaps for everything, or any other valid reason, then it is not possible to create Hi DPI QIcons.
When attempting to create
QPixMap, you'd expect to be able to do this:
qPix->setDevicePixelRatio(devicePixelRatio()); QIcon icon(qPix); // <-- we should be good to go now, right?
and have the scale setting (why is it called PixelRatio?) to be preserved in the icon, but it is not. :(
is there some magic invocation i can do to get this to work with QPixMaps (not files, and not themes) ?
see how all icons come out low-dpi:
This bug was previously reported here, but then ignored because... the maintainer thought the report was ... "too convoluted to be useful" (?) It seems quite straight forward to me, IMHO :)
please: if you would also like to see this bug in Qt fixed, please click the bug and upvote it. thanks.