Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Control the position of where the submenu is displayed.
Qt 6.11 is out! See what's new in the release blog

Control the position of where the submenu is displayed.

Scheduled Pinned Locked Moved Mobile and Embedded
2 Posts 1 Posters 2.5k 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.
  • I Offline
    I Offline
    ibvsleepy
    wrote on last edited by
    #1

    I am using QMenu to create a pop up menu in a limited screen environment 160x100.

    I need to have the submenu displayed in the same screen location as the parent menu.
    Essentially, on top of the parent menu instead of to the right and starting at the
    menu item.

    So what would be the best way to control the placement of a submenu.

    I have tried manipulating the submenu from the aboutToShow event but was unsucessful with what I tried. I have also tried setting the minimumSize and maximum size to the 160x100 and setting the size policy but was unsuccessful as well.

    1 Reply Last reply
    0
    • I Offline
      I Offline
      ibvsleepy
      wrote on last edited by
      #2

      I found a way. May not be the best but it works. Override the paintEvent and used move to get it where I needed it.

      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