jwflammer
28th February 2011, 00:01
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)"); but that's a lot of code, id like to have a For Loop
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)");
} but i get an error. What am i doing wrong?
ui->box_9_9->setStyleSheet("background-color: rgb(255,0,0)"); but that's a lot of code, id like to have a For Loop
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)");
} but i get an error. What am i doing wrong?