Reputation: 109
First of all, I'm fairly new with Qt and Qt Creator so go easy if this is a stupid question.
I was practicing using Qt Creator, playing around with css styles. In particular, I'm trying to get the menubar and its menus to look something like this (on Windows): https://i.sstatic.net/9lMnQ.png.
However, the closest I've been able to get so far is this: https://i.sstatic.net/5Nlen.png.
I've searched online to see if anyone has tried something like this but I wasn't able to find anything.
The only possible solution I can think of is if the menubar item (with no bottom border) could be rendered in above the menu, so that they overlap, covering its top border over the width that they overlap.
If that won't work or is impossible or whatever please do suggest any other solutions/workarounds/hacks.
Thanks in advance!
Upvotes: 0
Views: 650
Reputation: 4344
I think that the only good solution is to avoid any tricks and create a new widget:
QWidget
with Qt::Popup
attribute.QMenu
into a layout of the widget.QMenuBar
item which is clicked using QMenuBar::getActionGeometry
.QWidget::setMask
to make it look like a rectangle with a tab.QMenu
.Upvotes: 0