summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qwidget_mac.mm
diff options
context:
space:
mode:
authorMorten Sørvig <msorvig@trolltech.com>2009-05-06 10:58:33 (GMT)
committerMorten Sørvig <msorvig@trolltech.com>2009-05-06 10:58:33 (GMT)
commitb38874c55ec7d046c3ff3ba08599d52e004c0146 (patch)
tree65377f2ce9b54aa21360be424f1cd7cfe521eed3 /src/gui/kernel/qwidget_mac.mm
parent6586200d3043ba7915bc60695e2a1436a5cadfa3 (diff)
downloadQt-b38874c55ec7d046c3ff3ba08599d52e004c0146.zip
Qt-b38874c55ec7d046c3ff3ba08599d52e004c0146.tar.gz
Qt-b38874c55ec7d046c3ff3ba08599d52e004c0146.tar.bz2
Optimize QCocoaView::registerDragTypes and mode switching in QtCreator.
We were registering the types each time drag and drop was enabled, which caused slowdowns when for example switching between the Edit and Debug modes in QtCreator. Instead, register the types on first enable and also when the custom types change. Add check to draggingEntered() that disables the drag if WA_DropSiteRegistered is false. Reviewed-by: nrc
Diffstat (limited to 'src/gui/kernel/qwidget_mac.mm')
-rw-r--r--src/gui/kernel/qwidget_mac.mm4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm
index 3f89ff3..b315eaf 100644
--- a/src/gui/kernel/qwidget_mac.mm
+++ b/src/gui/kernel/qwidget_mac.mm
@@ -4497,8 +4497,8 @@ void QWidgetPrivate::registerDropSite(bool on)
SetControlDragTrackingEnabled(qt_mac_nativeview_for(q), on);
#else
NSView *view = qt_mac_nativeview_for(q);
- if ([view isKindOfClass:[QT_MANGLE_NAMESPACE(QCocoaView) class]]) {
- [static_cast<QT_MANGLE_NAMESPACE(QCocoaView) *>(view) registerDragTypes:on];
+ if (on && [view isKindOfClass:[QT_MANGLE_NAMESPACE(QCocoaView) class]]) {
+ [static_cast<QT_MANGLE_NAMESPACE(QCocoaView) *>(view) registerDragTypes];
}
#endif
}