QButtonGroup, how to get a button by object name?
Solved
General and Desktop
-
I have an instance of QButtonGroup, to this I have two QRadioButton's. I have given each radio button an object name using setObjectName, in the debugger I can see that each radio button has the names Male and Female. I can also see that the list returned from the QButtonGroup shows in the debugger as:
*([0]) "Male"
*([1]) "Female"How can I get the button from the group using the object name as a look-up ?
-
-
@HoMa , simply because the application assigned a unique object name using setObjectName, where as the id is an integer. I am just asking if there is a way to use the object name assigned to get the object. I don't think it can be used, but thought I would ask anyway.
-
-
@Christian-Ehrlicher , thank you:
QAbstractButton* pobjMale(cpobjButtonGroup->findChild<QAbstractButton*>("Male"));