I have a group project for the school I'm working on. One member of my group created a window with ~ 75 switches. I want all of them to be “clear” or “unverified” at the click of a button.
Does anyone know a good way to do this? I studied QObjectList, but I can't just do QObjectList * children = new QObjectList (ui-> groupBox-> children ()); and loop them using the for loop, since QObjectList does not have the following method.
I also tried to do something like
QObjectList *children = new QObjectList(ui->groupBox->children()); for(QObject *iterator = children.first(); iterator!=NULL; children.pop_front()){ iterator = children.first(); iterator->at(0)->setCheckabled(false); }
But since the iterator is a QObject, setCheckable does not exist, as on a radio button.
Thoughts / tips will be appreciated.
Edit: I will even hint at a way to iterate over variables with similar names. For example, all my radio objects are called RadioButton_1, RadioButton_2, etc.
source share