Important: Please read the Qt Code of Conduct -

Add more content to QMenu

  • Hello,

    I am working on an dashboard / launcher application the prototype of which "looks like this":

    To do this I basically show() or hide() a child QWidget.

    However, I am trying to find what widget fits better the role. I have been thinking of extending the QMenu class, because it inherently has this the behaviour of this dashboard.

    Yet a menu's not supposed to host much content other than menu-items (basically icons+labels). Is it however possible to extend a QMenu class to add any kind of content (i.e. layouts, widgets) to it?


  • You can't add layouts to a QMenu, but you can add widgets containing menus to a QMenu using "QWidgetAction":

Log in to reply