I have a 10 by 10 grid of frames, i can change their backgrounds with
ui->box_9_9->setStyleSheet("background-color: rgb(255,0,0)");
ui->box_9_9->setStyleSheet("background-color: rgb(255,0,0)");
To copy to clipboard, switch view to plain text mode
but that's a lot of code, id like to have a For Loop
int count;
for (count = 0; count <= 10; count++)
{
boxnum += "box_";
boxnum += "_";
ui->boxnum->setStyleSheet("background-color: rgb(255,0,0)");
}
int count;
QString boxnum;
for (count = 0; count <= 10; count++)
{
boxnum += "box_";
boxnum += QString::number(count);
boxnum += "_";
boxnum += QString::number(count);
ui->boxnum->setStyleSheet("background-color: rgb(255,0,0)");
}
To copy to clipboard, switch view to plain text mode
but i get an error. What am i doing wrong?
Bookmarks