Carlos, I tried what you suggested in a class that is derived from QProgressBar. This is my code:
void MyProgressBar::onStarted()
{
setFormat(tr("Preparing"));
greenBrush.setStyle(Qt::SolidPattern);
this->setPalette(p);
}
void MyProgressBar::onStarted()
{
setFormat(tr("Preparing"));
QPalette p = this->palette();
QBrush greenBrush(QColor(0, 255, 0, 255));
greenBrush.setStyle(Qt::SolidPattern);
p.setBrush(QPalette::Active, QPalette::Highlight, greenBrush);
p.setBrush(QPalette::Inactive, QPalette::Highlight, greenBrush);
this->setPalette(p);
}
To copy to clipboard, switch view to plain text mode
But the color doesn't change. Maybe you can spot my mistake?
Bookmarks