summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/qwindowswindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/windows/qwindowswindow.cpp')
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index 6e75b9aa1b..92cf8c253e 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -1888,6 +1888,8 @@ void QWindowsWindow::handleDpiChanged(HWND hwnd, WPARAM wParam, LPARAM lParam)
// Scale child QPlatformWindow size. Windows sends WM_DPICHANGE to top-level windows only.
for (QWindow *childWindow : window()->findChildren<QWindow *>()) {
QWindowsWindow *platformChildWindow = static_cast<QWindowsWindow *>(childWindow->handle());
+ if (!platformChildWindow)
+ continue;
QRect currentGeometry = platformChildWindow->geometry();
QRect scaledGeometry = QRect(currentGeometry.topLeft() * scale, currentGeometry.size() * scale);
platformChildWindow->setGeometry(scaledGeometry);