diff options
author | Jeremy Katz <jeremy.katz@nokia.com> | 2009-11-19 10:43:20 (GMT) |
---|---|---|
committer | Jeremy Katz <jeremy.katz@nokia.com> | 2009-11-19 10:43:20 (GMT) |
commit | c357ab6fbb673f75e9f2ccb2da5d3a938eaadf1f (patch) | |
tree | 7cd48b67a8452bb35d25cde2f63321358189b037 /src/gui/painting/qgraphicssystem.cpp | |
parent | 8fc2eec5b3282665f76f1e0313a03608bf4e7bc1 (diff) | |
download | Qt-c357ab6fbb673f75e9f2ccb2da5d3a938eaadf1f.zip Qt-c357ab6fbb673f75e9f2ccb2da5d3a938eaadf1f.tar.gz Qt-c357ab6fbb673f75e9f2ccb2da5d3a938eaadf1f.tar.bz2 |
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.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/gui/painting/qgraphicssystem.cpp b/src/gui/painting/qgraphicssystem.cpp index 2071127..948223d 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 *>(); |