Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Can you nest QActionWidgets in a QMenu to emulate submenus?
Qt 6.11 is out! See what's new in the release blog

Can you nest QActionWidgets in a QMenu to emulate submenus?

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 550 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.
  • SkylerS Offline
    SkylerS Offline
    Skyler
    wrote on last edited by
    #1

    Hello,

    I'm using a QActionWidget in a QMenu's submenu to render my own modified menu which works great on the first level, but when I get to an element in my QActionWidget that I'd like to further filter down into another submenu, I'm not seeing a way to do this since the QMenu handling ceases. Hopefully that makes sense, basically i want to emulate a QMenu w/ a dynamic number of submenus using QActionWidgets.

    Currently, when I find a menu item i want to expand into a submenu, I have it create a new menu w/ another QActionWidget and popup() that menu next to the original one, but this doesn't natively emulate how a menu should act when a user moves their mouse to a different parent menu item (closing the no longer relevent submenu) etc. Also, the event filters get limited to the newly created QMenu which makes it hard to try to emulate the proper handling on my own.

    Alternatively, is there a better solution for this? I basically need a menu that allows for 2 columns of text that justify nicely respective of all text in the menu entries.

    Thanks for any suggestions!
    -Skyler

    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