Details
-
Bug
-
Resolution: Out of scope
-
Not Evaluated
-
None
-
5.7.0
-
None
-
Windows 10
Description
On windows, when you move a window between two monitors with differing DPI the window keeps the same raw pixel dimensions, so either the content ends up squashed or cut when moving from low DPI -> high DPI or the window ends up bigger than the screen in the other direction. The window should keep the same logical size relative to its content instead.
For anyone else having this problem, as a workaround you can force system DPI scaling so the window is down/upscaled by windows when it's not on the primary display using the following code at the top of main():
#ifdef _WIN32 { typedef BOOL (*SetProcessDpiAwarenessT)(int value); QLibrary user32("user32.dll", NULL); SetProcessDpiAwarenessT SetProcessDpiAwarenessD = (SetProcessDpiAwarenessT)user32.resolve("SetProcessDpiAwarenessInternal"); if (SetProcessDpiAwarenessD) SetProcessDpiAwarenessD(1); //PROCESS_PER_MONITOR_DPI_AWARE } #endif
Attachments
Issue Links
- is duplicated by
-
QTBUG-55449 Window and Widgets are scaled inproperly when per-monitor-dpi awareness is set and application is moved between 1080p/4k monitors
- Closed
-
QTBUG-58959 QMessageBox does not scale well when using per monitor dpiawareness mode
- Closed
- relates to
-
QTBUG-55639 [REG: 5.5.1->5.6.1] QDockWidget cannot be properly docked on a secondary screen that has negative position
- Closed
For Gerrit Dashboard: QTBUG-55510 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
185451,2 | Resize the window when the screen's dpi changes | 5.9 | qt/qtbase | Status: MERGED | +2 | 0 |
199461,7 | Windows QPA: Further restrict windows for WM_DPICHANGED | 5.9 | qt/qtbase | Status: MERGED | +2 | 0 |