Qt version: 4.4.3:
Consider the code:
// ...
// Used for the naming of the checkboxes
unsigned count= 1;
// Adds the checkboxes empty
for(unsigned j= 1; j<= 8; ++j)
{
++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);
}
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);
}
To copy to clipboard, switch view to plain text mode
I want to make the checkbox named "checkBox_1", to become << checkBox_1->setCheckState(Qt::Checked); >> How can I do that?
Thanks.
Bookmarks