Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. adding an icon to a submenu in qml

adding an icon to a submenu in qml

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 260 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Roman P
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved