diff options
author | Norwegian Rock Cat <qt-info@nokia.com> | 2009-07-06 12:08:41 (GMT) |
---|---|---|
committer | Norwegian Rock Cat <qt-info@nokia.com> | 2009-07-06 12:12:56 (GMT) |
commit | fd181167709283a2ceefa5285d6189fa7de23bb6 (patch) | |
tree | 702100755edfa2f63e3c20248ebc87ae4311389b /src/gui/kernel | |
parent | 18a717b3f2e6a19a5ad631b68b26d09ba934bece (diff) | |
download | Qt-fd181167709283a2ceefa5285d6189fa7de23bb6.zip Qt-fd181167709283a2ceefa5285d6189fa7de23bb6.tar.gz Qt-fd181167709283a2ceefa5285d6189fa7de23bb6.tar.bz2 |
Implement QApplication::setOverrideCursor to use pure Cocoa calls
Seems this was a victim of our cursor fixing. Cocoa does a lot for us
with setting cursors. This meant that we didn't need to do as much
meddling and as a result qt_mac_set_cursor does nothing in Cocoa.
Unfortunately, this broke setOverrideCursor. Luckily Cocoa has a stack
that works exactly like Qt, so we can just use that.
Task-number: 257507
Reviewed-by: Prasanth Ullattil
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qapplication_mac.mm | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/gui/kernel/qapplication_mac.mm b/src/gui/kernel/qapplication_mac.mm index 5ded153..0d86c8e 100644 --- a/src/gui/kernel/qapplication_mac.mm +++ b/src/gui/kernel/qapplication_mac.mm @@ -1294,8 +1294,13 @@ void QApplication::setOverrideCursor(const QCursor &cursor) { qApp->d_func()->cursor_list.prepend(cursor); +#ifdef QT_MAC_USE_COCOA + QMacCocoaAutoReleasePool pool; + [static_cast<NSCursor *>(qt_mac_nsCursorForQCursor(cursor)) push]; +#else if (qApp && qApp->activeWindow()) qt_mac_set_cursor(&qApp->d_func()->cursor_list.first(), QCursor::pos()); +#endif } void QApplication::restoreOverrideCursor() @@ -1304,12 +1309,17 @@ void QApplication::restoreOverrideCursor() return; qApp->d_func()->cursor_list.removeFirst(); +#ifdef QT_MAC_USE_COCOA + QMacCocoaAutoReleasePool pool; + [NSCursor pop]; +#else if (qApp && qApp->activeWindow()) { const QCursor def(Qt::ArrowCursor); qt_mac_set_cursor(qApp->d_func()->cursor_list.isEmpty() ? &def : &qApp->d_func()->cursor_list.first(), QCursor::pos()); } -} #endif +} +#endif // QT_NO_CURSOR QWidget *QApplication::topLevelAt(const QPoint &p) { |