QRadioButtons in two different layouts
I have defined QRadiobuttons in two different layouts.Three in the one and 3 in the other, respectively. These buttons should be independe开发者_开发问答nt, but when i push one of the one layout the other button from the other layout is deselected. And therefore there is always only one Radiobutton selected. I want to be able to select one Radiobutton from the one layout and one from the other. How could I avoid this problem. Thanks
From the QRadioButton docs:
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. If you need multiple exclusive button groups for radio buttons that belong to the same parent widget, put them into a QButtonGroup.
(Auto-exclusive is on by default.)
You should do that (and continue adding the individual QRadioButtons
to your layout).
精彩评论