1

My menu bar is placed inside my toolbar :) And I wan't both of them to have the same background color. In some color themes menubar background is different then in toolbars (lighter). How do I sync them and at the same time maintain current theme colors.

Can I force QMenuBar not to draw background ?

I tried to use stylesheets with background-color:.. but submenus in menu bar lose borders and there is now hover effect.

Thanks for help :)

Angie Quijano
  • 4,167
  • 3
  • 25
  • 30

1 Answers1

5

You can try something like this:

QPalette palette = menuBar->palette();
palette.setColor(QPalette::Button,  toolBar->palette().color(QPalette::Window));
menuBar->setPalette(palette);

Hope this helps :)

Sebastian Dusza
  • 2,470
  • 2
  • 30
  • 54