From 79498af6e44d8c44b681c1a857523d633d3aea3a Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Fri, 15 Feb 2013 14:44:18 +0100 Subject: Fix the default handling of cursor shape when there is no standard one MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the cursor specified is a bitmap one we cannot cache it based on the shape as the pixmap set on the cursor may be different. Therefore we should always create a new cursor in this instance. Change-Id: I2c201590ff632490d76c1b423908ae32aa584eb6 Reviewed-by: Morten Johan Sørvig --- src/plugins/platforms/cocoa/qcocoacursor.mm | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/plugins/platforms/cocoa/qcocoacursor.mm b/src/plugins/platforms/cocoa/qcocoacursor.mm index 9b30351d70..b97531545f 100644 --- a/src/plugins/platforms/cocoa/qcocoacursor.mm +++ b/src/plugins/platforms/cocoa/qcocoacursor.mm @@ -96,10 +96,15 @@ void QCocoaCursor::changeCursor(QCursor *cursor, QWindow *window) break; case Qt::DragLinkCursor: [[NSCursor dragLinkCursor] set]; + break; default : { // No suitable OS cursor exist, use cursors provided // by Qt for the rest. Check for a cached cursor: NSCursor *cocoaCursor = m_cursors.value(cursor->shape()); + if (cocoaCursor && cursor->shape() == Qt::BitmapCursor) { + [cocoaCursor release]; + cocoaCursor = 0; + } if (cocoaCursor == 0) { cocoaCursor = createCursorData(cursor); if (cocoaCursor == 0) { -- cgit v1.2.3