Results 1 to 5 of 5

Thread: QTableWidget radio buttons

  1. #1
    Join Date
    Dec 2011
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default QTableWidget radio buttons

    Hello!

    This is my first post at this forum; it seems nice =)

    Anyway. I have added a QTableWidget with 3 different tabs. However, I would like all the radio buttons in the different tabs to "know about each other", so that if I check one radiobutton in Tab1 all other radiobuttons in Tab2 and Tab3 will be unchecked. Is there a simple way to do this? Have tried the QButtonGroup but without sucess :S

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: QTableWidget radio buttons

    Create a function on each tab which enable or disable the radio buttons. Then simple use the signal and slot mechanism to connect the actions.

  3. #3
    Join Date
    Dec 2011
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QTableWidget radio buttons

    Great solution, working on that right now! However, there is a problem: radio buttons is designed that at least ONE of them should be enabled. So if I enable one at Tab1 for example, I can't disable all radio buttons in Tab1 if I move to Tab2. I havent found a function for it at least.

  4. #4
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: QTableWidget radio buttons

    Hmm, since I don't know what exactly you are doing, QCheckBox could also be an option for you. Or disable the whole button group/QGroupBox.

  5. #5
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: QTableWidget radio buttons

    You could use another, invisible, radio button on each page to represent "nothing else checked".

Similar Threads

  1. Non editable Radio Buttons
    By babu198649 in forum Newbie
    Replies: 9
    Last Post: 11th November 2009, 11:48
  2. Increase the size of radio buttons
    By arunvv in forum Qt Programming
    Replies: 7
    Last Post: 24th January 2009, 00:09
  3. Radio buttons in a tree view
    By notwithstanding in forum Qt Programming
    Replies: 6
    Last Post: 3rd November 2008, 22:32
  4. array of radio buttons
    By amulya in forum Qt Programming
    Replies: 4
    Last Post: 5th October 2006, 12:59
  5. How to get larger radio buttons on XP?
    By Ben.Hines in forum Qt Programming
    Replies: 9
    Last Post: 24th April 2006, 19:00

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.