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.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/gui/kernel/qplatformcursor_qpa.cpp b/src/gui/kernel/qplatformcursor_qpa.cpp
index 06954864f2..ed103a51d4 100644
--- a/src/gui/kernel/qplatformcursor_qpa.cpp
+++ b/src/gui/kernel/qplatformcursor_qpa.cpp
@@ -40,10 +40,9 @@
****************************************************************************/
#include "qplatformcursor_qpa.h"
-#include <QWidget>
#include <QPainter>
#include <QBitmap>
-#include <QApplication>
+#include <QGuiApplication>
#include <QDebug>
@@ -99,6 +98,21 @@ QPlatformCursor::QPlatformCursor(QPlatformScreen *scr )
QPlatformCursorPrivate::instances.append(this);
}
+extern int qt_last_x;
+extern int qt_last_y;
+
+QPoint QPlatformCursor::pos() const
+{
+ // As a fallback return the last mouse position seen by QGuiApplication.
+ return QPoint(qt_last_x, qt_last_y);
+}
+
+void QPlatformCursor::setPos(const QPoint &pos)
+{
+ Q_UNUSED(pos);
+ qWarning("This plugin does not support QCursor::setPos()");
+}
+
// End of display and pointer event handling code
// Beginning of built-in cursor graphics
// from src/gui/embedded/QGraphicsSystemCursorImage_qws.cpp
@@ -566,7 +580,7 @@ void QPlatformCursorImage::set(const uchar *data, const uchar *mask,
if (!width || !height || !data || !mask || cursorImage.isNull())
return;
- cursorImage.setNumColors(3);
+ cursorImage.setColorCount(3);
cursorImage.setColor(0, 0xff000000);
cursorImage.setColor(1, 0xffffffff);
cursorImage.setColor(2, 0x00000000);