Qt Code:
  1. int main(int argc, char *argv[])
  2. {
  3. QApplication app(argc, argv);
  4.  
  5. QMainWindow window;
  6. QStatusBar statusBar;
  7. QPalette palette;
  8.  
  9. window.setWindowTitle("QMainWindow with Colored QStatusBar");
  10. window.setFixedSize(300,100);
  11. window.setStatusBar(&statusBar);
  12.  
  13. palette.setColor(QPalette::Background, Qt::red);
  14.  
  15. statusBar.setPalette(palette);
  16. statusBar.showMessage("Red QStatusBar");
  17. window.show();
  18.  
  19. return app.exec();
  20. }
To copy to clipboard, switch view to plain text mode 

i used the example code but the background color remained as the default one.
any idea?

4.jpg