Since Qt 5.9 there's a `ScaledPixmapHook` in `QIconEngine` which is called when device pixel ratio is > 1 and it wants a scaled pixmap. In contrast to regular `pixmap()` this also knows the scale factor.
Implement support for `Icon Scale` properties introduced in Icon naming specification 0.13 [1] to choose an appropriate icon, if available, In contrast to regular pixmap this also knows the scale factrather than blatantly loading a larger icon that may not fit in the context and also could be hard to tell as its physical size will be smaller than what it was designed for.
This way, when a 32px icon is requested, we can now tell whether we want a 16px scaled 2x or if it's a legitimate 32px request. It ensures that we keep symbolic small icons even on high-dpi screens where we would otherwise load the colorful and hard-to-see icons at the given physical size they ends up at.[1] https://specifications.freedesktop.org/icon-theme-spec/icon-theme-spec-0.13.html