I am trying to replace the PNG icons in my app with SVG versions to fully support scalable UI. My app is already able to scale properly (e.g. when Windows scale settings are above 100%), but I have 1x icons so they look blurry at higher scales.
I've found that the behavior when using SVG icons in QAction + QToolBar + context menu is inconsistent with the PNG images behavior.
I want to replace a 9x12px PNG with a SVG image with a view box with 9x12 size, the problem is that the tool bar won't respect that size and it will make the SVG image take all the available size.
I tried creating a SVG version with a view box that matches the toolbar icon size (by adding padding to it), but then the size in the context menu is wrong.
What I expect is that both PNG and SVG images look the same size in the toolbar and then context menu, and that the SVG will look crisp at scales bigger than 100%. The toolbar or the toolbar button is able to center the PNG image into the 18x18 icon size, but the SVG just takes all the available size (keeping the aspect ratio) ignoring the view box or width/height properties.
Check attached screenshot and project for more details. The screenshots were taken at 100% and 200% screen scale in Windows.