summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qwidget_mac.mm
diff options
context:
space:
mode:
authorNorwegian Rock Cat <qt-info@nokia.com>2009-04-14 13:02:34 (GMT)
committerNorwegian Rock Cat <qt-info@nokia.com>2009-04-14 13:35:39 (GMT)
commit56feb92927d48edffcd09491091ec735b86a820d (patch)
tree114a4e229ab0f46a4ea56a7031e20456bf7f9260 /src/gui/kernel/qwidget_mac.mm
parent9a41b437be6014c7a671591e2741c5ca7d8c8be8 (diff)
downloadQt-56feb92927d48edffcd09491091ec735b86a820d.zip
Qt-56feb92927d48edffcd09491091ec735b86a820d.tar.gz
Qt-56feb92927d48edffcd09491091ec735b86a820d.tar.bz2
Fix a bug where a widget would not always get the correct Cursor in Cocoa
Cocoa has a different way of dealing with cursors than our heavy handed approach that we used in Carbon. We simply need to re-implement the proper function in NSView and set up the rectangles for the cursor correctly. We also need to expose an QCursor2NSCursor type functions since the current QCursor::handle() is useless for doing this and we shouldn't change that. With this change things seem to work much more like the native stuff for both Carbon and Cocoa.
Diffstat (limited to 'src/gui/kernel/qwidget_mac.mm')
-rw-r--r--src/gui/kernel/qwidget_mac.mm14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm
index e7dfde5..827e098 100644
--- a/src/gui/kernel/qwidget_mac.mm
+++ b/src/gui/kernel/qwidget_mac.mm
@@ -2847,12 +2847,26 @@ void QWidgetPrivate::updateSystemBackground()
void QWidgetPrivate::setCursor_sys(const QCursor &)
{
+ Q_Q(QWidget);
+#ifndef QT_MAC_USE_COCOA
qt_mac_update_cursor();
+#else
+ if (q->testAttribute(Qt::WA_WState_Created)) {
+ [qt_mac_window_for(q) invalidateCursorRectsForView:qt_mac_nativeview_for(q)];
+ }
+#endif
}
void QWidgetPrivate::unsetCursor_sys()
{
+ Q_Q(QWidget);
+#ifndef QT_MAC_USE_COCOA
qt_mac_update_cursor();
+#else
+ if (q->testAttribute(Qt::WA_WState_Created)) {
+ [qt_mac_window_for(q) invalidateCursorRectsForView:qt_mac_nativeview_for(q)];
+ }
+#endif
}
void QWidgetPrivate::setWindowTitle_sys(const QString &caption)