int main(int argc, char *argv[])
{
window.setWindowTitle("QMainWindow with Colored QStatusBar");
window.setFixedSize(300,100);
window.setStatusBar(&statusBar);
palette.
setColor(QPalette::Background, Qt
::red);
statusBar.setPalette(palette);
statusBar.showMessage("Red QStatusBar");
window.show();
return app.exec();
}
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QMainWindow window;
QStatusBar statusBar;
QPalette palette;
window.setWindowTitle("QMainWindow with Colored QStatusBar");
window.setFixedSize(300,100);
window.setStatusBar(&statusBar);
palette.setColor(QPalette::Background, Qt::red);
statusBar.setPalette(palette);
statusBar.showMessage("Red QStatusBar");
window.show();
return app.exec();
}
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
Bookmarks