prykHetQuo
29th January 2009, 06:13
Qt version: 4.4.3:
Consider the code:
QWidget *scrollAreaWidgetContents;
// ...
// Used for the naming of the checkboxes
unsigned count= 1;
// Adds the checkboxes empty
for(unsigned j= 1; j<= 8; ++j)
{
QCheckBox *checkBox= new QCheckBox(scrollAreaWidgetContents);
++count;
checkBox->setObjectName(QString("checkBox_%1").arg(QString::number(count)));
checkBox->setGeometry(QRect(50* (j+ 1)+ 37, 20* i, 83, 20));
}
// ...
switch(runLevelsInfostring[0])
{
case '0':
scrollAreaWidgetContents.nextInFocusChain()->setCheckState(Qt::Checked);
}
I want to make the checkbox named "checkBox_1", to become << checkBox_1->setCheckState(Qt::Checked); >> How can I do that?
Thanks.
Consider the code:
QWidget *scrollAreaWidgetContents;
// ...
// Used for the naming of the checkboxes
unsigned count= 1;
// Adds the checkboxes empty
for(unsigned j= 1; j<= 8; ++j)
{
QCheckBox *checkBox= new QCheckBox(scrollAreaWidgetContents);
++count;
checkBox->setObjectName(QString("checkBox_%1").arg(QString::number(count)));
checkBox->setGeometry(QRect(50* (j+ 1)+ 37, 20* i, 83, 20));
}
// ...
switch(runLevelsInfostring[0])
{
case '0':
scrollAreaWidgetContents.nextInFocusChain()->setCheckState(Qt::Checked);
}
I want to make the checkbox named "checkBox_1", to become << checkBox_1->setCheckState(Qt::Checked); >> How can I do that?
Thanks.