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

White borders / stripes around screen on some devices

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Not Evaluated Not Evaluated
    • None
    • 5.7.1, 5.8.0, 5.9.0 Beta 3
    • QPA
    • None
    • Android

      On some devices (like Nexus 5X, Huawei MediaPad M3) if one uses QML

      ApplicationWindow {
          visibility: Window.FullScreen
          visible: true
      
          // color: "#FF000000" // possible "workaround"
      }
      

      with

      QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
      

      there will be some ~1px white border / stripes around screen.

      Digging deeper I found it's Qt problem with rounding.

      Huawei MediaPad M3 has 2600px x 1600px resolution with density (getDisplayMetrics().density) 3.0 what gives 853.(3)dp x 533.(3)dp. Qt rounds that down to 853dp x 533dp and multiplying it by devicePixelRatio (3.0) results in 2599px x 1599px - hence the white borders around the screen.

      Nexus 5X is similar case - it has 1920px x 1080px resolution with density  2.625 what gives ~731.43dp x 411,43dp, Qt counts that as 731dp x 411dp what after multiplying by 2.625 results in ~1919px x ~1079px.

      Possible "workaround" is to set ApplicationWindow's background color to black, so it's less noticeable, but it's still there (and what's more I'm not sure if this property sets OpenGL clear color or I'm doing unnecessary full screen overdraw here).

      Another one I'm thinking about is to check on Java side those values, discover when such error will occur and then disable Qt auto scale and calculate own values, but it's troublesome and ugly.

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

            esabraha Eskil Abrahamsen Blomfeldt
            maciej_gamedesire Maciej Węglarczyk
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes