adding an icon to a submenu in qml
Unsolved
QML and Qt Quick
-
I have a Menu in qml that pops up on right click. It contains some Actions. Now I want to add a submenu inside that Menu. This submenu should also have an icon in front of the name to match the style of the Actions which doesn't seem to work.
The code looks like this:Menu: { delegate: CustomDelegate {...} Action{ icon.source: "some_icon.svg" ... } ... }
Now I add a Menu to that Menu.
Menu: { delegate: CustomDelegate {...} Action{ text: "Action1" icon.source: "some_icon.svg" ... } ... Menu { // this should look like the Actions with an icon in front of the name title: "SubMenu" ... } }
I tried a lot of different things to add the icon (like defining a background inside the SubMenu, working with DelegateChooser and many more) but always encountered some problems. I can not use MenuItem or Action because the submenu should open other submenus on hover. Has anyone an idea how to do that?
Thank you very much and best regards,
Roman