Results 1 to 3 of 3

Thread: how to get the index of the checked radio button inside a group box?

  1. #1
    Join Date
    Feb 2012
    Location
    Armenia/Yerevan
    Posts
    400
    Thanks
    15
    Thanked 16 Times in 15 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default how to get the index of the checked radio button inside a group box?

    let's say we have a group box including a few radio buttons. I need to get the index of the clicked or checked radio button so that
    I could use it as a parameter to a function, this simplifies my code, you have any idea if that's possible?
    if not I need to waste time checking the ischecked() method with if-else

  2. #2
    Join Date
    May 2011
    Posts
    240
    Thanks
    4
    Thanked 35 Times in 35 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Symbian S60

    Default Re: how to get the index of the checked radio button inside a group box?

    I don't know, but if that is not possible, one thing that might help here is adding the buttons to a QButtonGroup, which has for example buttonClicked(int id) signal just for this.

  3. #3
    Join Date
    Sep 2011
    Posts
    1,245
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: how to get the index of the checked radio button inside a group box?

    no, it is not possible. You are of course free to use QSignalMapper which will solve your problem.
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

Similar Threads

  1. How to checked if button is clicked
    By stbb24 in forum Newbie
    Replies: 3
    Last Post: 5th June 2012, 06:04
  2. Replies: 1
    Last Post: 26th April 2012, 10:36
  3. Replies: 2
    Last Post: 6th June 2011, 09:40
  4. Qt group for amateur radio programmers
    By waynew in forum Qt Programming
    Replies: 0
    Last Post: 2nd February 2010, 23:19
  5. Replies: 3
    Last Post: 25th July 2008, 14:30

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.