diff options
author | Prasanth Ullattil <prasanth.ullattil@nokia.com> | 2009-12-21 12:45:18 (GMT) |
---|---|---|
committer | Prasanth Ullattil <prasanth.ullattil@nokia.com> | 2009-12-21 15:51:56 (GMT) |
commit | 020b10e8288c981bffe1a6470ece25ec6c532b73 (patch) | |
tree | 11e094788e309810dddb7f53fe88c77c915229d5 /src | |
parent | a0f557d8576b233ba0c5417ff020a5aa438c4805 (diff) | |
download | Qt-020b10e8288c981bffe1a6470ece25ec6c532b73.zip Qt-020b10e8288c981bffe1a6470ece25ec6c532b73.tar.gz Qt-020b10e8288c981bffe1a6470ece25ec6c532b73.tar.bz2 |
Drag and drop icon not updated correctly in Cocoa.
QDragMoveEvent is compressed using the answer rect in QCocoaView. The
result of the last sendEvent is saved, so that we dont have to generate
a new event always. This saved result was not updated correctly when the
event was ignored.
Task-number: QTBUG-5186
Reviewed-by: Richard Moe Gustavsen
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/kernel/qcocoaview_mac.mm | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm index 6c06746..3352dbd 100644 --- a/src/gui/kernel/qcocoaview_mac.mm +++ b/src/gui/kernel/qcocoaview_mac.mm @@ -349,7 +349,9 @@ extern "C" { // since we accepted the drag enter event, the widget expects // future drage move events. // ### check if we need to treat this like the drag enter event. - nsActions = QT_PREPEND_NAMESPACE(qt_mac_mapDropAction)(qDEEvent.dropAction()); + nsActions = NSDragOperationNone; + // Save as ignored in the answer rect. + qDMEvent.setDropAction(Qt::IgnoreAction); } else { nsActions = QT_PREPEND_NAMESPACE(qt_mac_mapDropAction)(qDMEvent.dropAction()); } @@ -357,7 +359,6 @@ extern "C" { return nsActions; } } - - (NSDragOperation)draggingUpdated:(id < NSDraggingInfo >)sender { NSPoint windowPoint = [sender draggingLocation]; @@ -402,13 +403,15 @@ extern "C" { qDMEvent.setDropAction(QT_PREPEND_NAMESPACE(qt_mac_dnd_answer_rec).lastAction); qDMEvent.accept(); QApplication::sendEvent(qwidget, &qDMEvent); - qt_mac_copy_answer_rect(qDMEvent); NSDragOperation operation = qt_mac_mapDropAction(qDMEvent.dropAction()); if (!qDMEvent.isAccepted() || qDMEvent.dropAction() == Qt::IgnoreAction) { // ignore this event (we will still receive further notifications) operation = NSDragOperationNone; + // Save as ignored in the answer rect. + qDMEvent.setDropAction(Qt::IgnoreAction); } + qt_mac_copy_answer_rect(qDMEvent); return operation; } |