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

[Win][HighDpi]: Mouse event position issues with calling winId() for child widget in constructor

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.6.2, 5.8.0
    • None
    • Windows 7, Qt 5.6.2 MSVC 2015 32bit. Also reproduces with latest 5.8.0 rc snapshot. 2 monitors: 1920x1080 (primary) and 3840x2160 (secondary), 200% scaling

    Description

      If I create window and call winId() in window constructor for any widget on this window, this will lead to incorrect behavior of any mouse events for any widgets on this window.

      It seems to

      event->globalPos()
      

      is not equal to

      mapToGlobal(event->pos())
      

      mapToGlobal(event->pos()) always return correct position.

      The attached file contains simple example with context menu.

      P.S. In my case It reproduces only on 4k monitor if this monitor is not primary.

      Attachments

        1. 1.png
          1.png
          935 kB
        2. 2.png
          2.png
          973 kB
        3. TestProject4.zip
          2 kB
        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
            p.zhigalov Peter Zhigalov
            Votes:
            6 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes