Uploaded image for project: 'Qt Solutions'
  1. Qt Solutions
  2. QTSOLBUG-26

QWinWidget doesn't center dialog when on a secondary screen

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P1: Critical
    • Next Patch Release
    • Release 7
    • MFC Migration
    • None

    Description

      Reproducible with the "mfc/step3" or "winwidget" example, and opening a dialog while the main window is on a secondary screen. The dialog will open on the first screen.

      For 0/0 size widgets, ClientToScreen appears to return invalid values. A workaround/fix is to not give the QWinWidget a 0/0 size in center():

      @@ -167,7 +167,7 @@
      }
      RECT r;
      GetWindowRect(hParent, &r);

      • setGeometry((r.right-r.left)/2+r.left, (r.bottom-r.top)/2+r.top,0,0);
        + setGeometry((r.right-r.left)/2+r.left, (r.bottom-r.top)/2+r.top,1,1);
        }

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            vhilshei Volker Hilsheimer
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes