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

QWidget Rendering error when Windows11 laptop lid close then reopen

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.5
    • 5.15.2, 5.15.16
    • OS: windows 11 laptop (version: 10.0.22621),
      CPU: AMD Ryzen 7 5800H with Radeon Graphics
      RAM: 40960MB
      GPU: RTX 3060 Laptop GPU
    • Windows

    Description

      When a laptop running Windows 11 is connected to an external screen, QWidget windows may encounter rendering errors when the laptop lid is closed and reopened.

      The attachment contains the source code zip and video

      This is reproducible only on Windows11

      when first launch:

      when close the laptop lid, then reopen it:

      1, The laptop screen resolution is 2560 * 1600 (recommend),DPI scaling is 150% (recommend)
      2, The external screen resolution is 1920 * 1080 (recommend), and the DPI scaling is 100% (recommend)

      #include "mainwindow.h"
      
      #include <QApplication>
      
      int main(int argc, char *argv[])
      {
          // for 150% 175% dpi
          QGuiApplication::setHighDpiScaleFactorRoundingPolicy(
              Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
          // for high dpi
          QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
      
          QApplication a(argc, argv);
          MainWindow w;
          w.show();
          return a.exec();
      }
      

      Attachments

        1. TestWin11Laptop5-15-16.zip
          3 kB
        2. systemInfo-1.txt
          18 kB
        3. systemInfo.txt
          18 kB
        4. screenshot-2.png
          screenshot-2.png
          197 kB
        5. screenshot-1.png
          screenshot-1.png
          195 kB
        6. IMG_2999.mp4
          14.67 MB
        7. executable.zip
          17.24 MB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            liaqi Liang Qi
            leilei.ren leilei ren
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes