ui->Pipe_1->setStyleSheet(ui->Pipe_1->property(\"defaultStyleSheet\").toString() +
\" QProgressBar::chunk { background: #D7DF01; }\");
ui->Pipe_2->setS
You can very easily find all children matching a certain name pattern:
// C++11
auto pipes = findChildren(QRegExp("Pipe_[0-9]+"));
for (pipe : pipes) {
pipe->setStyleSheet(pipe->property("defaultStyleSheet").toString() +
" QProgressBar::chunk { background: #D7DF01; }");
}
// C++98
QList pipes = findChildren(QRegExp("Pipe_[0-9]+"));
foreach (pipe, pipes) {
pipe->setStyleSheet(pipe->property("defaultStyleSheet").toString() +
" QProgressBar::chunk { background: #D7DF01; }");
}