it doesn’t sound like a proper solution
scaling down the icons doesn’t seem quite right
The code not only scale down, but also scale up.
The scaling down will automatically happen again when QToolbar setting icons.
I think we have to scale it down to some value because if the user for whatever reason has an insanely large image, the memory consumption will be much higher.
In theory, we can scale perfectly to toolbar’s iconSize, however, the icon is also used for a few other purposes [1].
Since the original code hard coded Toolbar height to 21 and scale the image to 64. I think adjusting code to better scaling to 64×64 and removing arbitrary limitation of 21 would just fix the problem.
Do you want to propose a PR? If not, I can do it some time later.