Please nominate your Qt Champions for 2021! https://forum.qt.io/topic/132134/looking-for-the-2021-qt-champions
Qtdesigner: how radio button group together?
shalongbasi last edited by
I am using Qtdesigner for a UI interface. I found that if I use a Qgroupbox to group all Qradiobuttons together, and only Qradiobuttons, they can be selected normally, that mean one is selected and all other are unselected. But if I put Qrabiobuttons into one QgroupBox, and also, there are other stuffs in the same Qgroubox, such as label, lineedit, pushbutton, those radionbuttons cannot be checked exclusively. Is it possible to make them work with different items in the same groupbox?
musimbate last edited by
Have you considered arranging QRadioButtons in their groupboxes and then organize your design using layouts?I feel that QGroupBox is there to bundle QRadioButtons and QCheckBoxes together.
andre last edited by
You can also create a button group explicitly for your radio buttons. Select the ones you want to group, and right click on one of them. Then, you'll find an option to "group" the buttons. If you click that, you will notice that a new QButtonGroup has appeared in your object browser in designer. You can select that button group to give it a name, make it exclusive, etc.
Hareen Laks last edited by
Thanks. It is good to have rating systems for answers as well.
Bharath Ram last edited by
@andre I just logged into this old thread to say "Thank you" to Andre for the handy tip.