[Interest] widget rendering (alignment, sizing) issues on OS X

René J.V. Bertin rjvbertin at gmail.com
Tue May 31 10:06:33 CEST 2016


On Monday May 30 2016 15:22:50 Adam Light wrote:

Hi,

>To address this in our application, we use a QProxyStyle subclass in which
>we reimplement layoutSpacing on Macintosh like so:
>
>		if (spacing > 2) {
>			spacing /= 2;
>		}

You're full of interesting suggestions :)

Initial testing shows that could indeed be a solution, though a factor two seems a bit too much for radio buttons. And the way I implemented it at 2am it also nuked the colour palette which left me with windows sporting Qt's proprietary gray/beige. I take it you initialise the spacing variable from QProxyStyle::layoutSpacing(/*arguments we received*/)?

I see 2 potential uses for this trick:
1- make a style plugin that is just a proxy for the standard (Macintosh) style but adds a (possibly configurable) layout spacing adjustment. No idea as yet how much overhead that will require for something that takes about 20 lines of code, but it would make the fix available to every Qt application
2- provide it via a KF5 framework so that it becomes trivial to deploy it in application code. The possibility to add a style selector menu came up, and that menu could add a virtual "Macintosh - compact" style if the "Macintosh" style is available on the host.

The two approaches are of course not exclusive but I'm a bit hesitant to attack the 1st having only quite complex style plugins to use as an example.

R.



More information about the Interest mailing list