diff options
author | Prasanth Ullattil <prasanth.ullattil@nokia.com> | 2010-07-22 12:52:29 (GMT) |
---|---|---|
committer | Toby Tomkins <toby.tomkins@nokia.com> | 2010-07-23 01:18:53 (GMT) |
commit | 9b1e68e8ae5578654b1c2a514fef98c5bbea983d (patch) | |
tree | daf0884e0a520c399ac4088334ac9f64790ef882 | |
parent | 9a61d3f6c8a443791c1a379e4da80caf82737e9c (diff) | |
download | Qt-9b1e68e8ae5578654b1c2a514fef98c5bbea983d.zip Qt-9b1e68e8ae5578654b1c2a514fef98c5bbea983d.tar.gz Qt-9b1e68e8ae5578654b1c2a514fef98c5bbea983d.tar.bz2 |
Drag & Drop failing in itemviews on Cocoa.
While generating the QDragMoveEvent, we were always reusing the last
drop action set by the user. This is not correct, we should copy the action
only if a valid action set before. This is the behavior on Windows.
Task-number: QTBUG-9486
Reviewed-by: Denis
(cherry picked from commit 88410105978d5fb4344207cd5d296057ced0f27d)
-rw-r--r-- | src/gui/kernel/qcocoaview_mac.mm | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm index 1935531..a552ce7 100644 --- a/src/gui/kernel/qcocoaview_mac.mm +++ b/src/gui/kernel/qcocoaview_mac.mm @@ -390,7 +390,10 @@ static int qCocoaViewCount = 0; if (QDragManager::self()->source()) mimeData = QDragManager::self()->dragPrivate()->data; QDragMoveEvent qDMEvent(posDrag, qtAllowed, mimeData, QApplication::mouseButtons(), modifiers); - qDMEvent.setDropAction(QT_PREPEND_NAMESPACE(qt_mac_dnd_answer_rec).lastAction); + if (QT_PREPEND_NAMESPACE(qt_mac_dnd_answer_rec).lastAction != Qt::IgnoreAction + && QT_PREPEND_NAMESPACE(qt_mac_dnd_answer_rec).buttons == qDMEvent.mouseButtons() + && QT_PREPEND_NAMESPACE(qt_mac_dnd_answer_rec).modifiers == qDMEvent.keyboardModifiers()) + qDMEvent.setDropAction(QT_PREPEND_NAMESPACE(qt_mac_dnd_answer_rec).lastAction); qDMEvent.accept(); QApplication::sendEvent(qwidget, &qDMEvent); |