From c357ab6fbb673f75e9f2ccb2da5d3a938eaadf1f Mon Sep 17 00:00:00 2001 From: Jeremy Katz Date: Thu, 19 Nov 2009 11:43:20 +0100 Subject: added QGraphicsSystemScreen::topLevelAt(): find the window at a global position This is used to determine which widget to send a pointer event to, and to implement QApplication::widgetAt(). --- src/gui/painting/qgraphicssystem.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/gui/painting/qgraphicssystem.cpp') diff --git a/src/gui/painting/qgraphicssystem.cpp b/src/gui/painting/qgraphicssystem.cpp index 2071127fcb..948223d3b3 100644 --- a/src/gui/painting/qgraphicssystem.cpp +++ b/src/gui/painting/qgraphicssystem.cpp @@ -85,6 +85,19 @@ QPixmapData *QGraphicsSystem::createDefaultPixmapData(QPixmapData::PixelType typ } #ifdef Q_WS_LITE +QWidget *QGraphicsSystemScreen::topLevelAt(const QPoint & pos) const +{ + QWidgetList list = QApplication::topLevelWidgets(); + for (int i = list.size()-1; i >= 0; --i) { + QWidget *w = list[i]; + //### mask is ignored + if (w != QApplication::desktop() && w->isVisible() && w->geometry().contains(pos)) + return w; + } + + return 0; +} + QList QGraphicsSystem::screens() const { return QList(); -- cgit v1.2.3