Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
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
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 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(); }