Scalable icons in Qt applications
Since most of our icons are SVG ones now and Qt applications may read them, it makes sense to make them actually scalable to support system UI scaling. What we need to do:
- Make OpenMW-CS dpi-aware (implemented as a part of !4016 (merged))
- Deploy Qt SVG icon engine plugin (in addition to SVG format plugin)
- Use SVGs for Wizard icons
- Do not construct icons from pixmaps. So instead of
QPushButton(QIcon(QPixmap(":scenetoolbar/brush-custom"))
we should use
QPushButton(QIcon(":scenetoolbar/brush-custom"))
to allow Qt to scale SVG icons properly. If there is a need to use pixmap, it should be created from QIcon
object:
folderIconLabel->setPixmap(QIcon(":folder").pixmap(QSize(48, 48)));
Such approach takes in account scaling factor as well.
Edited by Andrei Kortunov