How to customize menubar menu title?
-
Good day,
I'm trying to create a menubar with QML where one of the titles of the menu has a different color background, but I found it not possible as haven't found anything on how to modify the title of the Menu.
In the docs on customizing elements it's said that we can create a custom menubar, though nothing said on how to tweak titles.
This is what i get:
This is what i want:
without being selected nor hovered. Is this possible?
I would appreciate any hint on this topic.
Regards,
noxnivi -
Good day,
I went back through the Qt QML documentation, after @JoeCFD said it was possible, and found a way. Not sure if it's the right one, but last night I tried and it worked.
The 'answer' is to use a MenuBarItem item in the MenuBar. Though for what I've read, it's not supposed to be used as it's implicitly called when creating a <Menu>, adding a <MenuBarItem> inside the Menubar allows to fully customize the MenuBar element, as all the properties available to MenuBarItem will be accesible.
There might be a better solution to this question, but for now, what I just pointed out seems to work (needs deep testing anyway).
Be this the answer, can mark the issue as solved. If not, please let me know the proper way to achieve this.Thanks again @JoeCFD.
Regards,
noxnivi