Results 1 to 10 of 10

Thread: How to get larger radio buttons on XP?

  1. #1
    Join Date
    Feb 2006
    Posts
    21
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Windows

    Default How to get larger radio buttons on XP?

    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!

  2. #2
    Join Date
    Jan 2006
    Location
    Mountain View, CA
    Posts
    279
    Thanked 42 Times in 37 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to get larger radio buttons on XP?

    Have you tried QApplication::setGlobalStrut()?
    Save yourself some pain. Learn C++ before learning Qt.

  3. #3
    Join Date
    Feb 2006
    Posts
    21
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Windows

    Default Re: How to get larger radio buttons on XP?

    Yes. I'm using the global strut, which causes push buttons to be drawn larger. However, it has no effect on the radio buttons.

  4. #4
    Join Date
    Jan 2006
    Location
    Mountain View, CA
    Posts
    279
    Thanked 42 Times in 37 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to get larger radio buttons on XP?

    Do me a favor - try setting the style of one of your radiobuttons to just plain "windows" and see if it works.
    Save yourself some pain. Learn C++ before learning Qt.

  5. #5
    Join Date
    Feb 2006
    Posts
    21
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Windows

    Default Re: How to get larger radio buttons on XP?

    OK.

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

  6. #6
    Join Date
    Jan 2006
    Location
    Mountain View, CA
    Posts
    279
    Thanked 42 Times in 37 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to get larger radio buttons on XP?

    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).
    Save yourself some pain. Learn C++ before learning Qt.

  7. The following user says thank you to Chicken Blood Machine for this useful post:

    Ben.Hines (24th April 2006)

  8. #7
    Join Date
    Feb 2006
    Posts
    21
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Windows

    Default Re: How to get larger radio buttons on XP?

    BTW Chicken Blood,

    Your picture sort of freaks me out.

  9. #8
    Join Date
    Jan 2006
    Location
    Mountain View, CA
    Posts
    279
    Thanked 42 Times in 37 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to get larger radio buttons on XP?

    Quote Originally Posted by Ben.Hines
    BTW Chicken Blood,

    Your picture sort of freaks me out.
    It freaks me out too.
    Save yourself some pain. Learn C++ before learning Qt.

  10. #9
    Join Date
    Jan 2006
    Posts
    39
    Thanks
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: How to get larger radio buttons on XP?

    Quote Originally Posted by Ben.Hines
    Your picture sort of freaks me out.
    LOL. Me too. Reminds me of the kid in the original Omen movie (even if his hair was dark).

  11. #10
    Join Date
    Mar 2006
    Location
    Mountain View, California
    Posts
    489
    Thanks
    3
    Thanked 74 Times in 54 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to get larger radio buttons on XP?

    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.

Similar Threads

  1. Increase the size of radio buttons
    By arunvv in forum Qt Programming
    Replies: 7
    Last Post: 24th January 2009, 00:09
  2. Radio buttons in a tree view
    By notwithstanding in forum Qt Programming
    Replies: 6
    Last Post: 3rd November 2008, 22:32
  3. Programatically setting radio buttons
    By Doug Broadwell in forum Newbie
    Replies: 2
    Last Post: 25th May 2007, 20:55
  4. array of radio buttons
    By amulya in forum Qt Programming
    Replies: 4
    Last Post: 5th October 2006, 12:59

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.