diff options
author | Samuel Rødal <samuel.rodal@nokia.com> | 2011-05-04 16:43:45 +0200 |
---|---|---|
committer | Samuel Rødal <samuel.rodal@nokia.com> | 2011-05-04 16:59:33 +0200 |
commit | 6229ef2dcec19e28ad0dd5772f2e144523ccf475 (patch) | |
tree | 6929cd8608180e26de7bc40b361bb4d007e6804e /src/gui/kernel/qapplication_qpa.cpp | |
parent | d7b91f613d648cad0883ff4d03c445b4eefebd1e (diff) |
Get rid of more QWidget / QApplication dependencies.
Diffstat (limited to 'src/gui/kernel/qapplication_qpa.cpp')
-rw-r--r-- | src/gui/kernel/qapplication_qpa.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/gui/kernel/qapplication_qpa.cpp b/src/gui/kernel/qapplication_qpa.cpp index e1876e41a9..f3e033c787 100644 --- a/src/gui/kernel/qapplication_qpa.cpp +++ b/src/gui/kernel/qapplication_qpa.cpp @@ -65,6 +65,7 @@ #include <QPlatformIntegration> #include "qdesktopwidget_qpa_p.h" +#include "qwidgetwindow_qpa_p.h" QT_BEGIN_NAMESPACE @@ -343,13 +344,15 @@ QWidget *QApplication::topLevelAt(const QPoint &pos) // The first screen in a virtual environment should know about all top levels if (pi->isVirtualDesktop()) { - QWidget *w = (*screen)->topLevelAt(pos); - return w; + QWidgetWindow *w = qobject_cast<QWidgetWindow *>((*screen)->topLevelAt(pos)); + return w ? w->widget() : 0; } while (screen != end) { - if ((*screen)->geometry().contains(pos)) - return (*screen)->topLevelAt(pos); + if ((*screen)->geometry().contains(pos)) { + QWidgetWindow *w = qobject_cast<QWidgetWindow *>((*screen)->topLevelAt(pos)); + return w ? w->widget() : 0; + } ++screen; } return 0; |