PDA

View Full Version : Menu bar on Windows



Steven
20th October 2009, 11:23
Using a QMenuBar on a QMainWindow, the menu bar always shows up white, but in all other Windows applications it shows up as the normal window background color. I know I can achieve the effect by using a stylesheet (background-color: transparent), but is this the only way? It seems strange considering that this is normally default for a windows app.

spirit
20th October 2009, 11:48
try to use something like this:


...
QApplication::setPalette(QApplication::style()->standardPalette());
...

but there is note in Qt Assistant


Note: Some styles do not use the palette for all drawing, for instance, if they make use of native theme engines. This is the case for the Windows XP, Windows Vista, and Mac OS X styles.