summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPrasanth Ullattil <prasanth.ullattil@nokia.com>2009-07-03 11:46:22 (GMT)
committerPrasanth Ullattil <prasanth.ullattil@nokia.com>2009-07-03 12:20:04 (GMT)
commitb43cbebc5353b7e6b2a3812046a23f327a12c4dc (patch)
tree770d1b85cf3ff141c499a3049f7e6ff3230b5bb8
parent460e204c5b96cb67244bd9463ca0dfa56ad02564 (diff)
downloadQt-b43cbebc5353b7e6b2a3812046a23f327a12c4dc.zip
Qt-b43cbebc5353b7e6b2a3812046a23f327a12c4dc.tar.gz
Qt-b43cbebc5353b7e6b2a3812046a23f327a12c4dc.tar.bz2
Drag leave event is delivered, after re-entering the widget.
This happens only for widgets with focus frames. Since the mouse location at the time of this event will be outside of the focus frame, we cannot use it to identify the widget. Instead, use the QDragManager's currentTarget() to deliver the drag leave event. Task-number: 252088 Reviewed-by: Norwegian Rock Cat
-rw-r--r--src/gui/kernel/qdnd_mac.mm4
-rw-r--r--src/gui/kernel/qwidget_mac.mm8
2 files changed, 10 insertions, 2 deletions
diff --git a/src/gui/kernel/qdnd_mac.mm b/src/gui/kernel/qdnd_mac.mm
index b244d84..99399da 100644
--- a/src/gui/kernel/qdnd_mac.mm
+++ b/src/gui/kernel/qdnd_mac.mm
@@ -405,12 +405,12 @@ bool QWidgetPrivate::qt_mac_dnd_event(uint kind, DragRef dragRef)
SetDragDropAction(dragRef, qt_mac_dnd_map_qt_actions(qDEEvent.dropAction()));
if (!qDEEvent.isAccepted())
- // The widget is simply not interrested in this
+ // The widget is simply not interested in this
// drag. So tell carbon this by returning 'false'. We will then
// not receive any further move, drop or leave events for this widget.
return false;
else {
- // Documentation states that a drag move event is sendt immidiatly after
+ // Documentation states that a drag move event is sent immediately after
// a drag enter event. So we do that. This will honor widgets overriding
// 'dragMoveEvent' only, and not 'dragEnterEvent'
QDragMoveEvent qDMEvent(q->mapFromGlobal(QPoint(mouse.h, mouse.v)), qtAllowed, dropdata,
diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm
index 250cc35..d1e4230 100644
--- a/src/gui/kernel/qwidget_mac.mm
+++ b/src/gui/kernel/qwidget_mac.mm
@@ -1369,6 +1369,14 @@ OSStatus QWidgetPrivate::qt_widget_event(EventHandlerCallRef er, EventRef event,
// Set dropWidget to zero, so qt_mac_dnd_event
// doesn't get called a second time below:
dropWidget = 0;
+ } else if (ekind == kEventControlDragLeave) {
+ dropWidget = QDragManager::self()->currentTarget();
+ if (dropWidget) {
+ dropWidget->d_func()->qt_mac_dnd_event(kEventControlDragLeave, drag);
+ }
+ // Set dropWidget to zero, so qt_mac_dnd_event
+ // doesn't get called a second time below:
+ dropWidget = 0;
}
}
}