PDA

View Full Version : QGroupBox to QButtonGroup Conversion



Ahmed Abdellatif
13th August 2018, 09:39
I have a QGroupBox which has 50 QRadioButtons. The radio buttons are added to the UI of the project. I want to progromatically convert the QGroupBox to QButtonGroup to get benefit of the functions that are found in the QButtonGroup. Is there any other way to do that conversion. If there is not, so how to add the 30 QRadioButton to the QButtonGroup other than use the addButton() function? It is not logic to make 50 addButton() function.
thanks in advance

wysota
20th August 2018, 09:46
What benefits do you mean? You cannot 'convert' one to the other as they serve different purposes (QButtonGroup is not a widget). If all the radio buttons have the same parent, they should behave as if they were part of the same button group (that is they should be mutually exclusive).