From 375b52f20f12e9180d2b4e2dce9f53facbdb4a21 Mon Sep 17 00:00:00 2001 From: Bernd Weimer Date: Thu, 12 Jun 2014 15:28:44 +0200 Subject: QNX: Override QPlatformScreen::topLevelAt Implemented QQnxScreen::topLevelAt method, as base implementation returned wrong results. This fixes "tst_qwidget widgetAt" for instance. Removed related method, that is not used at all. Change-Id: I25c4f474cb0d661e5e5cdcdd0ab13d670fd4dc37 Reviewed-by: Fabian Bumberger Reviewed-by: Rafael Roquetto --- src/plugins/platforms/qnx/qqnxscreen.cpp | 25 ++++++++++++------------- src/plugins/platforms/qnx/qqnxscreen.h | 4 ++-- 2 files changed, 14 insertions(+), 15 deletions(-) (limited to 'src/plugins/platforms/qnx') diff --git a/src/plugins/platforms/qnx/qqnxscreen.cpp b/src/plugins/platforms/qnx/qqnxscreen.cpp index 9ba0f5cd2e..add45ecbe5 100644 --- a/src/plugins/platforms/qnx/qqnxscreen.cpp +++ b/src/plugins/platforms/qnx/qqnxscreen.cpp @@ -286,6 +286,18 @@ Qt::ScreenOrientation QQnxScreen::orientation() const return orient; } +QWindow *QQnxScreen::topLevelAt(const QPoint &point) const +{ + QListIterator it(m_childWindows); + it.toBack(); + while (it.hasPrevious()) { + QWindow *win = it.previous()->window(); + if (win->geometry().contains(point)) + return win; + } + return 0; +} + /*! Check if the supplied angles are perpendicular to each other. */ @@ -767,17 +779,4 @@ void QQnxScreen::setRootWindow(QQnxWindow *window) m_rootWindow = window; } -QWindow * QQnxScreen::topMostChildWindow() const -{ - if (!m_childWindows.isEmpty()) { - - // We're picking up the last window of the list here - // because this list is ordered by stacking order. - // Last window is effectively the one on top. - return m_childWindows.last()->window(); - } - - return 0; -} - QT_END_NAMESPACE diff --git a/src/plugins/platforms/qnx/qqnxscreen.h b/src/plugins/platforms/qnx/qqnxscreen.h index a0b760135f..6b2281f7b9 100644 --- a/src/plugins/platforms/qnx/qqnxscreen.h +++ b/src/plugins/platforms/qnx/qqnxscreen.h @@ -73,6 +73,8 @@ public: Qt::ScreenOrientation nativeOrientation() const; Qt::ScreenOrientation orientation() const; + QWindow *topLevelAt(const QPoint &point) const; + bool isPrimaryScreen() const { return m_primaryScreen; } int rotation() const { return m_currentRotation; } @@ -124,8 +126,6 @@ private: void addMultimediaWindow(const QByteArray &id, screen_window_t window); void removeOverlayOrUnderlayWindow(screen_window_t window); - QWindow *topMostChildWindow() const; - screen_context_t m_screenContext; screen_display_t m_display; QQnxWindow *m_rootWindow; -- cgit v1.2.3