PDA

View Full Version : How to mimic the way Qt Creator's menu bar looks?



wayfaerer
21st February 2012, 19:00
I really like the look of Qt Creator's menu bar in Windows 7 (haven't tried it on other operating systems), as opposed to Windows 7's default light blue menu bar, which I find rather ugly. How can I get the same (or similar) look in my QMainWindow's menuBar()?

Should I use style sheets, QStyle, or something else?

One thing I have tried is putting this into my main window's constructor:


setStyleSheet("QMenuBar {background-color: rgb(225,225,225);}");

but it is only applying the gray background to the area to the right of the menu titles (e.g., File, Edit, View, etc.). However, I am not sure if this is even the right approach.

m.p
21st February 2012, 23:40
Take a look at QtCreator source code.