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. Position of submenu in QMenu
Qt 6.11 is out! See what's new in the release blog

Position of submenu in QMenu

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 757 Views 1 Watching
  • 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
    Raffa
    wrote on last edited by
    #1

    Dear QtUsers,
    I have a QMenu as submenu of another QMenu.
    Is there a way to set the preferred position for the showing of the submenu?
    Thank you very much for your support

    Pl45m4P 1 Reply Last reply
    0
    • R Raffa

      Dear QtUsers,
      I have a QMenu as submenu of another QMenu.
      Is there a way to set the preferred position for the showing of the submenu?
      Thank you very much for your support

      Pl45m4P Offline
      Pl45m4P Offline
      Pl45m4
      wrote on last edited by
      #2

      @Raffa said in Position of submenu in QMenu:

      Is there a way to set the preferred position for the showing of the submenu?

      • https://doc.qt.io/qt-5/qmenu.html#exec

      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      R 1 Reply Last reply
      0
      • Pl45m4P Pl45m4

        @Raffa said in Position of submenu in QMenu:

        Is there a way to set the preferred position for the showing of the submenu?

        • https://doc.qt.io/qt-5/qmenu.html#exec
        R Offline
        R Offline
        Raffa
        wrote on last edited by
        #3

        @Pl45m4 as far as I understand, exec open the menu in a defined position (used for example for a "right click" menu in a window).
        My problem is that the submenu is opening, but on the "wrong side" of the main menu.
        I'm asking if there is a way to set the "side" where the submenu should be shown

        Pl45m4P 1 Reply Last reply
        0
        • R Raffa

          @Pl45m4 as far as I understand, exec open the menu in a defined position (used for example for a "right click" menu in a window).
          My problem is that the submenu is opening, but on the "wrong side" of the main menu.
          I'm asking if there is a way to set the "side" where the submenu should be shown

          Pl45m4P Offline
          Pl45m4P Offline
          Pl45m4
          wrote on last edited by
          #4

          @Raffa

          or aligned to a widget:

          exec(somewidget.mapToGlobal(QPoint(0, 0)));
          

          You can specify a position where you execute/show your menu.


          If debugging is the process of removing software bugs, then programming must be the process of putting them in.

          ~E. W. Dijkstra

          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