QTie
15th June 2011, 07:48
Hello. I have following components on my MainWindow ui: groupBox1, label1, button1.
Problem is that I need to set some properties at the same time to groupBox1, label1, button1 and groupBox2, label2 etc
Is there a way or iterator (foreach, for) to do this by changing the index number of the components. Thanks.
int i = 1;
ui->groupBox[i]->setEnabled(true);
ui->label[i]->setText("some text");
----------------------
current code:
ui->groupBox1->setEnabled(true);
ui->label1->setText("some text");
Problem is that I need to set some properties at the same time to groupBox1, label1, button1 and groupBox2, label2 etc
Is there a way or iterator (foreach, for) to do this by changing the index number of the components. Thanks.
int i = 1;
ui->groupBox[i]->setEnabled(true);
ui->label[i]->setText("some text");
----------------------
current code:
ui->groupBox1->setEnabled(true);
ui->label1->setText("some text");