I have a list of dynamically created QCheckBoxes as:
for (int d=0; d<5; ++d)
{
sendToLayout->addWidget(checkBox);
connect(checkBox, SIGNAL(stateChanged(int)), this, SLOT(handleDestinationChange(int)));
}
for (int d=0; d<5; ++d)
{
QCheckBox *checkBox = new QCheckBox(names[d], this);
sendToLayout->addWidget(checkBox);
connect(checkBox, SIGNAL(stateChanged(int)), this, SLOT(handleDestinationChange(int)));
}
To copy to clipboard, switch view to plain text mode
I get the callback in the slot handleDestinationChange method. I want to do the same thing when each is checked, I just want to use the QString from checkBox->text() in the slot. The question is, how can I tell which of the 5 check boxes was the one that was checked? Only the check state is passed to the slot.
Thanks for any ideas.
Craig
Bookmarks