hello

why I can't change the color of progressbar ?


Qt Code:
  1. QList<QProgressBar *> pblist = parent->findChildren<QProgressBar *>();
  2. if(!pblist.isEmpty()){
  3. foreach(QProgressBar* ouptr, pblist){
  4. pal = ouptr->palette();
  5. pal.setColor(QPalette::Highlight, Qt::red);
  6. ouptr->setPalette(pal);
  7. ouptr->setValue(50);
  8. }
  9. }
To copy to clipboard, switch view to plain text mode