QMenuBar background image overlays Qmenu text when width of window is small
-
Hello,
We use QSS to style the qmenubar and qmenu. For qmenubar it looks like this:
QMenuBar { background: white no-repeat right center url(foobar.png); }This works fine and puts the image in the right of the menubar. But when you shrink the width of the app window such that the background image touches and mixes with the qmenus in the qmenubar, the image overlays the qmenus and it doesn't look good. I don't think the qmenu qss has anything relevant in it.
Is there a way to make it so the image dissappears behind the qmenu?
QMenuBar with image on right when window is large enough :

Problem when window width is small and mix happens:

"this is test" is an image.
QT version 5.15
Platform WindowsThanks,
Adam -
Hello,
We use QSS to style the qmenubar and qmenu. For qmenubar it looks like this:
QMenuBar { background: white no-repeat right center url(foobar.png); }This works fine and puts the image in the right of the menubar. But when you shrink the width of the app window such that the background image touches and mixes with the qmenus in the qmenubar, the image overlays the qmenus and it doesn't look good. I don't think the qmenu qss has anything relevant in it.
Is there a way to make it so the image dissappears behind the qmenu?
QMenuBar with image on right when window is large enough :

Problem when window width is small and mix happens:

"this is test" is an image.
QT version 5.15
Platform WindowsThanks,
Adam@HowitzerDev Menu bar items have a transparent background by default, so the menu bar will be visible. You can style the items to have opaque background using
QMenuBar:itemstyle and that will cover the menu bar background under the items. -
H HowitzerDev has marked this topic as solved on