summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@digia.com>2013-04-24 22:50:53 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-04-25 19:59:16 +0200
commitb06b51975929f56c37203ddc77379417a933384f (patch)
treeac8e7dc590437a2749a92fdee79a81a096b0ec6a /src
parent38608486744cbecafb63c0609635102a1671fe8d (diff)
Respect the hotspot when creating the cursor in Cocoa
The hotspot was not taken from the QCursor so if one was set then it was reset to 0x0. Change-Id: Ie81f1c2ac15a16f10436738367e612c44dc42d38 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/platforms/cocoa/qcocoacursor.mm14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoacursor.mm b/src/plugins/platforms/cocoa/qcocoacursor.mm
index 12808b7041..e5b41e7a88 100644
--- a/src/plugins/platforms/cocoa/qcocoacursor.mm
+++ b/src/plugins/platforms/cocoa/qcocoacursor.mm
@@ -199,14 +199,14 @@ NSCursor *QCocoaCursor::createCursorData(QCursor *cursor)
#endif
const uchar *cursorData = 0;
const uchar *cursorMaskData = 0;
- QPoint hotspot;
+ QPoint hotspot = cursor->hotSpot();
switch (cursor->shape()) {
case Qt::BitmapCursor: {
if (cursor->pixmap().isNull())
- return createCursorFromBitmap(cursor->bitmap(), cursor->mask());
+ return createCursorFromBitmap(cursor->bitmap(), cursor->mask(), hotspot);
else
- return createCursorFromPixmap(cursor->pixmap());
+ return createCursorFromPixmap(cursor->pixmap(), hotspot);
break; }
case Qt::BlankCursor: {
QPixmap pixmap = QPixmap(16, 16);
@@ -215,19 +215,19 @@ NSCursor *QCocoaCursor::createCursorData(QCursor *cursor)
break; }
case Qt::WaitCursor: {
QPixmap pixmap = QPixmap(QLatin1String(":/qt-project.org/mac/cursors/images/spincursor.png"));
- return createCursorFromPixmap(pixmap);
+ return createCursorFromPixmap(pixmap, hotspot);
break; }
case Qt::SizeAllCursor: {
QPixmap pixmap = QPixmap(QLatin1String(":/qt-project.org/mac/cursors/images/pluscursor.png"));
- return createCursorFromPixmap(pixmap);
+ return createCursorFromPixmap(pixmap, hotspot);
break; }
case Qt::BusyCursor: {
QPixmap pixmap = QPixmap(QLatin1String(":/qt-project.org/mac/cursors/images/waitcursor.png"));
- return createCursorFromPixmap(pixmap);
+ return createCursorFromPixmap(pixmap, hotspot);
break; }
case Qt::ForbiddenCursor: {
QPixmap pixmap = QPixmap(QLatin1String(":/qt-project.org/mac/cursors/images/forbiddencursor.png"));
- return createCursorFromPixmap(pixmap);
+ return createCursorFromPixmap(pixmap, hotspot);
break; }
#define QT_USE_APPROXIMATE_CURSORS
#ifdef QT_USE_APPROXIMATE_CURSORS