summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qplatformscreen_qpa.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel/qplatformscreen_qpa.cpp')
-rw-r--r--src/gui/kernel/qplatformscreen_qpa.cpp31
1 files changed, 11 insertions, 20 deletions
diff --git a/src/gui/kernel/qplatformscreen_qpa.cpp b/src/gui/kernel/qplatformscreen_qpa.cpp
index c9f3dc6f34..8759aa4a88 100644
--- a/src/gui/kernel/qplatformscreen_qpa.cpp
+++ b/src/gui/kernel/qplatformscreen_qpa.cpp
@@ -40,26 +40,23 @@
****************************************************************************/
#include "qplatformscreen_qpa.h"
-#include <QtGui/qapplication.h>
-#include <QtGui/private/qapplication_p.h>
-#include <QtGui/qdesktopwidget.h>
+#include <QtGui/qguiapplication.h>
+#include <QtGui/private/qguiapplication_p.h>
#include <QtGui/qplatformintegration_qpa.h>
-#include <QtGui/qwidget.h>
-#include <QtGui/private/qwidget_p.h>
+#include <QtGui/qwindow.h>
/*!
- Return the given top level widget for a given position.
+ Return the given top level window for a given position.
- Default implementation retrieves a list of all top level widgets and finds the first widget
+ Default implementation retrieves a list of all top level windows and finds the first window
which contains point \a pos
*/
-QWidget *QPlatformScreen::topLevelAt(const QPoint & pos) const
+QWindow *QPlatformScreen::topLevelAt(const QPoint & pos) const
{
- QWidgetList list = QApplication::topLevelWidgets();
+ QWindowList list = QGuiApplication::topLevelWindows();
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))
+ QWindow *w = list[i];
+ if (w->visible() && w->geometry().contains(pos))
return w;
}
@@ -81,15 +78,9 @@ QSize QPlatformScreen::physicalSize() const
return QSize(width,height);
}
-Q_GUI_EXPORT extern QWidgetPrivate *qt_widget_private(QWidget *widget);
-QPlatformScreen * QPlatformScreen::platformScreenForWidget(const QWidget *widget)
+QPlatformScreen * QPlatformScreen::platformScreenForWindow(const QWindow *)
{
- QWidget *window = widget->window();
- QWidgetPrivate *windowPrivate = qt_widget_private(window);
- QTLWExtra * topData = windowPrivate->topData();
- QPlatformIntegration *integration =
- QApplicationPrivate::platformIntegration();
- return integration->screens()[topData->screenIndex];
+ return QGuiApplicationPrivate::platformIntegration()->screens().at(0);
}
/*!