diff options
author | Prasanth Ullattil <prasanth.ullattil@nokia.com> | 2010-07-22 12:52:29 (GMT) |
---|---|---|
committer | Prasanth Ullattil <prasanth.ullattil@nokia.com> | 2010-07-22 14:25:40 (GMT) |
commit | 88410105978d5fb4344207cd5d296057ced0f27d (patch) | |
tree | a3724f7859f8ba558e5e6490ad16c6409952726e | |
parent | e8cdf0c57e269489c4759ddfec04daa4f093a13f (diff) | |
download | Qt-88410105978d5fb4344207cd5d296057ced0f27d.zip Qt-88410105978d5fb4344207cd5d296057ced0f27d.tar.gz Qt-88410105978d5fb4344207cd5d296057ced0f27d.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
-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); |