summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@digia.com>2015-01-12 20:58:53 +0100
committerAndy Shaw <andy.shaw@digia.com>2015-01-19 10:44:54 +0100
commit7c9497ad6ae9cb4b596bc76c70077577d97fe3cb (patch)
tree3009745c6cef8e9b9c7aeb085ca4c6f01e8d4a73
parent730d07df831435d41d40152d5ecec5dea2658042 (diff)
Respect the hotspot passed in for the cursor
When the hotspot is set to be QPoint(0,0) then QPoint will see this as being a null QPoint. However, it is a valid position as far as the hot spot for the cursor is concerned, so we default to QPoint(-1,-1) instead and check for that. Task-number: QTBUG-43787 Change-Id: Ibf6253033016c4b556b8a2a79c89819a4d5825cb Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
-rw-r--r--src/plugins/platforms/windows/qwindowscursor.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/plugins/platforms/windows/qwindowscursor.cpp b/src/plugins/platforms/windows/qwindowscursor.cpp
index d10c7fdb20..9a42b7712d 100644
--- a/src/plugins/platforms/windows/qwindowscursor.cpp
+++ b/src/plugins/platforms/windows/qwindowscursor.cpp
@@ -126,13 +126,15 @@ HCURSOR QWindowsCursor::createPixmapCursor(const QPixmap &pixmap, const QPoint &
// Create a cursor from image and mask of the format QImage::Format_Mono.
static HCURSOR createBitmapCursor(const QImage &bbits, const QImage &mbits,
- QPoint hotSpot = QPoint(),
+ QPoint hotSpot = QPoint(-1, -1),
bool invb = false, bool invm = false)
{
const int width = bbits.width();
const int height = bbits.height();
- if (hotSpot.isNull())
- hotSpot = QPoint(width / 2, height / 2);
+ if (hotSpot.x() < 0)
+ hotSpot.setX(width / 2);
+ if (hotSpot.y() < 0)
+ hotSpot.setY(height / 2);
const int n = qMax(1, width / 8);
#if !defined(Q_OS_WINCE)
QScopedArrayPointer<uchar> xBits(new uchar[height * n]);