summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qhighdpiscaling.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel/qhighdpiscaling.cpp')
-rw-r--r--src/gui/kernel/qhighdpiscaling.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gui/kernel/qhighdpiscaling.cpp b/src/gui/kernel/qhighdpiscaling.cpp
index 4b85973e92..4f8e9a3817 100644
--- a/src/gui/kernel/qhighdpiscaling.cpp
+++ b/src/gui/kernel/qhighdpiscaling.cpp
@@ -492,5 +492,13 @@ QPoint QHighDpiScaling::origin(const QPlatformScreen *platformScreen)
return platformScreen->geometry().topLeft();
}
+QPoint QHighDpiScaling::origin(const QWindow *window)
+{
+ if (window && window->isTopLevel() && window->screen())
+ return window->screen()->geometry().topLeft();
+
+ return QPoint(0, 0);
+}
+
#endif //QT_NO_HIGHDPISCALING
QT_END_NAMESPACE