See attached code (and or run it on a system similar to the attached qtdiag.txt). Notice there may be differences depending on primary screen, and which one is placed left or right etc.
However, Qt fails to resolve which screen the QMenu is shown on and gets a wrong size. Despite it is regression a regression it is not a major (P1) issue because there is an easy work-around with setting parent on the submenu to the menu. It however should be fixed.
|For Gerrit Dashboard: QTBUG-103309|
|411654,2||Fix QMenu size on first show||dev||qt/qtbase||Status: MERGED||+2||0|
|411657,7||Fix QWidget::metric to use widget screen dpr instead of app-dpr||dev||qt/qtbase||Status: MERGED||+2||0|
|412606,2||Fix QMenu size on first show||6.3||qt/qtbase||Status: MERGED||+2||0|
|412613,2||Fix QMenu size on first show||tqtc/lts-6.2||qt/tqtc-qtbase||Status: MERGED||+2||0|