Hi,

I need to change the color of a progress bar depending on its value.

I tried in some ways with poor results.

Qt Code:
  1. QPalette pal = ui->progressBar->palette();
  2. pal.setColor(QPalette::Normal, QPalette::Base, QColor("red"));
  3. //pal.setColor(QPalette::Highlight, Qt::red);
  4. //pal.setColor(QPalette::Background, Qt::red);
  5. ui->progressBar->setPalette(pal);
To copy to clipboard, switch view to plain text mode 

I also tried to change stylesheet from QT Creator, but nothing happens.

where am I wrong?

I'm using Qt 4.7, QT Creator 2.0.1, Ubuntu 10.10 64 bit.

thanks