When I create a QMainwindow only(that is ,there is no DockWidget,no central Widget),and the main area color is grey,how to change it to other color ,such as white?
Added after 8 minutes:
shows as picture.
windows.jpg
When I create a QMainwindow only(that is ,there is no DockWidget,no central Widget),and the main area color is grey,how to change it to other color ,such as white?
Added after 8 minutes:
shows as picture.
windows.jpg
Last edited by weixj2003ld; 5th July 2012 at 10:56.
Qt Code:
QMainWindow m; m.setStyleSheet("QMainWindow {background: 'yellow';}"); m.show();To copy to clipboard, switch view to plain text mode
Did you try subclassing QMainWindow's paintEvent?
What you want is to change the background of the centralWidget of the main window.
Bookmarks