Adding a qt.conf with dpiawareness=1 changes the behavior of QMenu when a dockwidget is moved to a different screen.
QMenu should be below the toolbar at all times. Please see the image expected.png
QMenu is entirely detached from the toolbar and outside the MainWindow, positioned towards the upper right or left corner of the screen. Please see the image actual.png.
Steps to reproduce the issue:
- Build the Dock Widgets example
- Add qt.conf with dpiawareness=1 (See attachment: qt.conf)
- Run Dock Widgets example
- Move either of the dock widgets to a different screen
- Click on any QToolbar
The actual position of the QMenu seems to remain relative to the MainWindow. The QMenu may appear on the upper right or left corner of the screen and this seems to be dependent on whether a dockwidget was moved to a screen on left or right respectively.
The QMenus returns to normal after the dockwidget is moved back to the same screen and the MainWindow is moved a bit.
Additionally, the buttons on the drop down can be clicked on both their expected position (right under the toolbar) and where the QMenu is actually displayed.
This bug has been reproduced with:
- 3 screen setup: 2560 x 1440 (200%), 3840 x 2160 (200%), 1600 x 1200 (100%)
- 2 screen setup: 2560 x 1600 (100%) and 2160 x 3840 (150%).