summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qplatformcursor_qpa.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel/qplatformcursor_qpa.cpp')
-rw-r--r--src/gui/kernel/qplatformcursor_qpa.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/gui/kernel/qplatformcursor_qpa.cpp b/src/gui/kernel/qplatformcursor_qpa.cpp
index fd7bcdcf18..a4e998ddbc 100644
--- a/src/gui/kernel/qplatformcursor_qpa.cpp
+++ b/src/gui/kernel/qplatformcursor_qpa.cpp
@@ -43,13 +43,22 @@
#include <QPainter>
#include <QBitmap>
#include <QGuiApplication>
+#include <QScreen>
+#include <QPlatformScreen>
#include <private/qguiapplication_p.h>
#include <QDebug>
QT_BEGIN_NAMESPACE
-QList <QWeakPointer<QPlatformCursor> > QPlatformCursorPrivate::instances;
+QList<QPlatformCursor *> QPlatformCursorPrivate::getInstances()
+{
+ QList<QPlatformCursor *> result;
+ foreach (const QScreen *screen, QGuiApplicationPrivate::screen_list)
+ if (QPlatformCursor *cursor = screen->handle()->cursor())
+ result.push_back(cursor);
+ return result;
+}
/*!
\class QPlatformCursor
@@ -93,10 +102,8 @@ QList <QWeakPointer<QPlatformCursor> > QPlatformCursorPrivate::instances;
Constructs a QPlatformCursor for the given \a screen.
*/
-QPlatformCursor::QPlatformCursor(QPlatformScreen *scr )
- : screen(scr)
+QPlatformCursor::QPlatformCursor()
{
- QPlatformCursorPrivate::instances.append(this);
}
QPoint QPlatformCursor::pos() const