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

QMenu is not shown properly at the first place with Qt::HighDpiScaleFactorRoundingPolicy::RoundPreferFloor set

    XMLWordPrintable

Details

    • Windows

    Description

      Sample attached. 2 monitors with different scaling, e.g. main screen at 100% and secondary at 150% respectively, Reproducible with 6.5.1. And implicitly, QA::AA_EnableHighDpiScaling is true by default.

      Steps to reproduce:
      1. Run the example and a window pops up. Right click inside the main window so that menu pops up.
      2. Move mouse cursor to whichever SubMenu. The sub menu layout looks normal on 100% screen. But looks clipped on 150% screen at the first place. Unless you move cursor away and back again. The sub menu looks normal at the second time.
      3. If QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::RoundPreferFloor); is commented out (so that only QA::AA_EnableHighDpiScaling is in effect), then everything looks OK.

      If main screen has larger scaling factor, e.g. main at 150% and secondary at 100%, the sub menu looks expanded. Please refer to the 4 screenshots. 'main4k250' and 'secondaryHD100' are from original reporter. I don't have 4K monitor so I only tested with 2 HD monitors. The result is shown by 'mainHD100' and 'secondaryHD150'.

      Is it because QA::AA_EnableHighDpiScaling is not compatible with RoundingPolicy? Or some other reasons?

      Attachments

        1. main4k250.png
          main4k250.png
          751 kB
        2. mainHD100.png
          mainHD100.png
          54 kB
        3. Sample.zip
          22 kB
        4. secondaryHD100.png
          secondaryHD100.png
          751 kB
        5. secondaryHD150.png
          secondaryHD150.png
          50 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            sorvig Morten Sørvig
            luqiaochen Luqiao Chen
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes