From d78bd439dcb290e4318734693d418937b0bf8129 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Wed, 5 Dec 2012 14:27:41 +0100 Subject: Offscreen testing platform plugin Useful for running auto-tests without popping up a bunch of windows in the windowing system. Thus they can be run in the background and even in parallel without focus issues. Change-Id: I8b14c6de258b41225480a0af5a2a9553663bc2b7 Reviewed-by: Jason McDonald --- src/gui/kernel/qguiapplication.cpp | 2 ++ src/gui/kernel/qplatformwindow.cpp | 16 ++++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) (limited to 'src/gui') diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 698c26763a..ebb42ea498 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -1070,6 +1070,8 @@ QGuiApplicationPrivate::~QGuiApplicationPrivate() delete platform_integration; platform_integration = 0; delete m_gammaTables.load(); + + window_list.clear(); } #if 0 diff --git a/src/gui/kernel/qplatformwindow.cpp b/src/gui/kernel/qplatformwindow.cpp index 01377d1aa0..88a82b12a3 100644 --- a/src/gui/kernel/qplatformwindow.cpp +++ b/src/gui/kernel/qplatformwindow.cpp @@ -196,7 +196,13 @@ bool QPlatformWindow::isEmbedded(const QPlatformWindow *parentWindow) const */ QPoint QPlatformWindow::mapToGlobal(const QPoint &pos) const { - return pos; + const QPlatformWindow *p = this; + QPoint result = pos; + while (p) { + result += p->geometry().topLeft(); + p = p->parent(); + } + return result; } /*! @@ -208,7 +214,13 @@ QPoint QPlatformWindow::mapToGlobal(const QPoint &pos) const */ QPoint QPlatformWindow::mapFromGlobal(const QPoint &pos) const { - return pos; + const QPlatformWindow *p = this; + QPoint result = pos; + while (p) { + result -= p->geometry().topLeft(); + p = p->parent(); + } + return result; } /*! -- cgit v1.2.3