PDA

View Full Version : QTableWidget radio buttons



Pettson
14th December 2011, 19:34
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

Lykurg
14th December 2011, 20:09
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.

Pettson
14th December 2011, 20:24
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.

Lykurg
14th December 2011, 20:59
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.

ChrisW67
15th December 2011, 09:51
You could use another, invisible, radio button on each page to represent "nothing else checked".