Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-101202

QMainWindow and main menu popups incorrectly positioned

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 6.2.4
    • Widgets: Main Window
    • None
    • Windows 10 21H2
    • Windows

    Description

      I noticed several issues with window and menu positioning that are likely related. I can reproduce these issues both in my application and in the qtbase/examples/widgets/mainwindows/mdi example.

      I suspect the problem may also be HighDPI related. I'm using a desktop machine with two identical 4k displays. Both use 200% scaling (OS setting). The display on the left is the primary display.

      To reproduce the issues I see, do the following:

      1. Start regedit.exe and navigate to HKCU\SOFTWARE\QtProject. If there is an "MDI Example" key, delete it.
      2. Build and run the mdi example application.
      3. The application will start (you can see the icon in the taskbar) but the main window will not be visible. I believe it is offscreen. (BUG1) To retrieve it, click on the application's icon in the taskbar and then press Alt+spacebar. This opens a menu. Use the arrow keys on the keyboard to move the highlight to Move and press Enter. Then press the right arrow key. This will make the window visible so you can move it with the mouse. Position the window so it is fully visible and click the left mouse button.
      4. Drag the title bar of the window to position it on the left (primary) display. Then click on one of the menu bar items. The menu pops up on the RIGHT display (not the left, as expected) (BUG2).
      5. With the window on the left display, quit the application. Then start it again. The window comes up on the RIGHT display (it should be on the left one, since that's where it was when quit) (BUG3).

      I've attached the relevant output about the screens from qtdiag.exe from Qt 5.15.3 and 6.2.4. This is for the same machine under identical conditions. Note that the Qt 6.2.4 output says there is only 1 screen, which is incorrect.

      qtdiag_screens.txt

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            aclight Adam Light
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes