Results 1 to 10 of 10

Thread: setchecked( true) of the radio button doesn't work

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2008
    Posts
    68

    Default Re: setchecked( true) of the radio button doesn't work

    As shown in the above sample code, the three radio buttons have been put in the QGroupBox so that only one radiobutton can be selected.

    however, if I want to clear the current selection and make all radiobutton unselected, what shall I do?

    thank you!

  2. #2
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: setchecked( true) of the radio button doesn't work

    try to add the following code to yours
    Qt Code:
    1. ...
    2. radio1->setCheckable(false);
    3. radio2->setCheckable(false);
    4. radio3->setCheckable(false);
    5. ...
    To copy to clipboard, switch view to plain text mode 
    but in this case you can't be able to check buttons at all.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  3. #3
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: setchecked( true) of the radio button doesn't work

    Radio buttons are "auto-exclusive" by default. If auto-exclusive is enabled, radio buttons that belong to the same parent widget behave as if they were part of the same exclusive button group.
    J-P Nurmi

  4. #4
    Join Date
    Dec 2008
    Posts
    68

    Default Re: setchecked( true) of the radio button doesn't work

    Thank you!

Similar Threads

  1. Coloring of Radio Button
    By jogeshwarakundi in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 22nd July 2008, 15:05
  2. Undoing radio button checks.
    By Doug Broadwell in forum Qt Programming
    Replies: 1
    Last Post: 22nd May 2007, 09:12
  3. Paint XP radio button to pixmap
    By Ben.Hines in forum Qt Programming
    Replies: 2
    Last Post: 26th April 2006, 21:15

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
  •  
Qt is a trademark of The Qt Company.