Control the position of where the submenu is displayed.



  • 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.



  • 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.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.