PDA

View Full Version : How to get larger radio buttons on XP?



Ben.Hines
24th April 2006, 16:18
Hello,

I'm developing an application that uses a touchscreen. I'm finding that radio buttons are difficult to press using the touchscreen because they are small. What is the best way to make the radio buttons larger? I thought of creating my own derivative of QWindowsXPStyle and implement the control drawing there. Or, implementing my own QRadioButton derivative that would implement the sizehint and paint methods. It seems to me that hte QStyle approach would work better because it will cause all radio buttons to be drawn larger without having to change that class type on every instance of a radio button.

Are there other approaches that are better?

Thanks!

Chicken Blood Machine
24th April 2006, 16:57
Have you tried QApplication::setGlobalStrut()?

Ben.Hines
24th April 2006, 17:02
Yes. I'm using the global strut, which causes push buttons to be drawn larger. However, it has no effect on the radio buttons.

Chicken Blood Machine
24th April 2006, 17:04
Do me a favor - try setting the style of one of your radiobuttons to just plain "windows" and see if it works.

Ben.Hines
24th April 2006, 18:23
OK.

I tried this with the QMotifStyle and the QWindowsStyle. Both drew the normal sized radio button.

Chicken Blood Machine
24th April 2006, 18:27
It's as I feared then. You will have to subclass QStyle to draw the radiobuttons larger.

You can also try replacing the radiobutton pixmap in the pixmap cache. See QPixmapCache to see how to do this (this may only work for Qt3).

Ben.Hines
24th April 2006, 18:39
BTW Chicken Blood,

Your picture sort of freaks me out.:eek:

Chicken Blood Machine
24th April 2006, 18:41
BTW Chicken Blood,

Your picture sort of freaks me out.:eek:
It freaks me out too.

drkbkr
24th April 2006, 18:43
Your picture sort of freaks me out.:eek:

LOL. Me too. Reminds me of the kid in the original Omen movie (even if his hair was dark).

Brandybuck
24th April 2006, 19:00
For a touchscreen application, I would do my own QStyle, just to give me better size control over all the widgets. You have to do this anyway for the radiobuttons, because in Windows (and most other styles) they are drawn from a predefined bitmap.