summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qgraphicssystem.cpp
diff options
context:
space:
mode:
authorJeremy Katz <jeremy.katz@nokia.com>2009-11-19 11:43:20 +0100
committerJeremy Katz <jeremy.katz@nokia.com>2009-11-19 11:43:20 +0100
commitc357ab6fbb673f75e9f2ccb2da5d3a938eaadf1f (patch)
tree7cd48b67a8452bb35d25cde2f63321358189b037 /src/gui/painting/qgraphicssystem.cpp
parent8fc2eec5b3282665f76f1e0313a03608bf4e7bc1 (diff)
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().
Diffstat (limited to 'src/gui/painting/qgraphicssystem.cpp')
-rw-r--r--src/gui/painting/qgraphicssystem.cpp13
1 files changed, 13 insertions, 0 deletions
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<QGraphicsSystemScreen *> QGraphicsSystem::screens() const
{
return QList<QGraphicsSystemScreen *>();