Hey! I try to do the following
QList<QButtonGroup*> groups;
for (int i=0; i<nGroup; i++)
{
QButtonGroup *objects = new QButtonGroup(this);
objects->setExclusive(false);
for (int j=0; j<nObject; j++)
{
Led *tempLed = new Led();
tempLed->setAutoExclusive(false);
layout->addWidget(tempLed,j,i,Qt::AlignLeft);
objects->addButton(tempLed);
}
groups.append(objects);
}
And then try to do something like this:
groups.at(1)->button(2)->setChecked(true);
The code compiles, but at runtime throws unhandled exception. What am I doing wrong? Any better way to create group of QButtonGroup?