summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2025-06-10 13:10:50 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2025-08-07 14:37:42 +0000
commit0a49ac910ef88164fd486276d60fae0eea8ce62e (patch)
treeef21fb471faf5bd36977497713b82c75eecfbff6
parent5eb0c676b12cb9bc7ab0eb813a53296b0f212a5b (diff)
macOS: Extend QCursor mapping to include WhatsThisCursor and BusyCursor6.10
This is similar to the mappings of Safari and Chromium, though both of them also map the unclickable wait cursor to busyButClickable. Requires private API use. Requests for public APIs in FB17882037 and FB17882136. Change-Id: Ieb3c009b5c88e7a68b1aa65f9307a1b36d29ef7a Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit a6c90bde912072168da8091dce0daeb858a8a2a3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/plugins/platforms/cocoa/qcocoacursor.mm18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoacursor.mm b/src/plugins/platforms/cocoa/qcocoacursor.mm
index 99759424f9c..39e42017611 100644
--- a/src/plugins/platforms/cocoa/qcocoacursor.mm
+++ b/src/plugins/platforms/cocoa/qcocoacursor.mm
@@ -13,6 +13,8 @@
#if !defined(QT_APPLE_NO_PRIVATE_APIS)
@interface NSCursor()
++ (id)busyButClickableCursor;
++ (id)_helpCursor;
+ (id)_windowResizeNorthWestSouthEastCursor;
+ (id)_windowResizeNorthEastSouthWestCursor;
+ (id)_windowResizeNorthSouthCursor;
@@ -109,7 +111,15 @@ NSCursor *QCocoaCursor::convertCursor(QCursor *cursor)
case Qt::IBeamCursor:
cocoaCursor = [NSCursor IBeamCursor];
break;
- case Qt::WhatsThisCursor: //for now just use the pointing hand
+ case Qt::WhatsThisCursor:
+#if !defined(QT_APPLE_NO_PRIVATE_APIS)
+ if ([NSCursor respondsToSelector:@selector(_helpCursor)]) {
+ cocoaCursor = [NSCursor performSelector:@selector(_helpCursor)];
+ break;
+ }
+#endif
+ // For now use the pointing hand as a fallback
+ Q_FALLTHROUGH();
case Qt::PointingHandCursor:
cocoaCursor = [NSCursor pointingHandCursor];
break;
@@ -134,6 +144,12 @@ NSCursor *QCocoaCursor::convertCursor(QCursor *cursor)
case Qt::DragLinkCursor:
cocoaCursor = [NSCursor dragLinkCursor];
break;
+ case Qt::BusyCursor:
+#if !defined(QT_APPLE_NO_PRIVATE_APIS)
+ if ([NSCursor respondsToSelector:@selector(busyButClickableCursor)])
+ cocoaCursor = [NSCursor performSelector:@selector(busyButClickableCursor)];
+#endif
+ break;
case Qt::SizeVerCursor:
case Qt::SizeHorCursor:
case Qt::SizeBDiagCursor: