Unsolved How to check the number of pushbuttons in one by one whether its enable or not
-
Is it possible to check number of pushbuttons in one by one ..
i thought that if we set the pushbutton name as a integer value means ,
int num = 0
pushbutton=1;
pushbutton_1=2;
pushbutton_2=3;like wise we changed this as a integer ,i can create code like this
for(int num=0;num<=i;num++) { //stuffs }
this idea is works ? ... give me some suggestion for this topic
-
@SURYA-P
Sounds like you want an array/list of (pointers to) your pushbuttons, so you can iterate over them?QList<QPushButton*> buttons; for (int i = 0; i < 3; i++) { buttons.append(new QPushButton); buttons[i].setText(QString::number(i)); }
-
QButtonGroup
(https://doc.qt.io/qt-5/qbuttongroup.html)