summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qt_cocoa_helpers_mac.mm
diff options
context:
space:
mode:
authorPrasanth Ullattil <prasanth.ullattil@nokia.com>2009-04-24 09:13:56 (GMT)
committerPrasanth Ullattil <prasanth.ullattil@nokia.com>2009-04-24 09:24:40 (GMT)
commit391940bb9e3eef13efad9550d6e35b3db6f83c17 (patch)
treec1b46e5d1b0cce9da94600cefdcd80cfd603a77a /src/gui/kernel/qt_cocoa_helpers_mac.mm
parent56ef2860a03e67afcb66c0827f1f258c7ae7c86d (diff)
downloadQt-391940bb9e3eef13efad9550d6e35b3db6f83c17.zip
Qt-391940bb9e3eef13efad9550d6e35b3db6f83c17.tar.gz
Qt-391940bb9e3eef13efad9550d6e35b3db6f83c17.tar.bz2
Drag and drop examples not working correctly in Cocoa
In the updated examples, the drag operation is changed in the drop-event handler, which was not handled correctly in the Cocoa. This is now supported for drag and drop from same application. If the drop was to another application, the drag will return the result from the last drag-move event. Task-number: 252103 Reviewed-by: nrc
Diffstat (limited to 'src/gui/kernel/qt_cocoa_helpers_mac.mm')
-rw-r--r--src/gui/kernel/qt_cocoa_helpers_mac.mm12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gui/kernel/qt_cocoa_helpers_mac.mm b/src/gui/kernel/qt_cocoa_helpers_mac.mm
index 52e76d8..f000292 100644
--- a/src/gui/kernel/qt_cocoa_helpers_mac.mm
+++ b/src/gui/kernel/qt_cocoa_helpers_mac.mm
@@ -515,6 +515,18 @@ Qt::KeyboardModifiers qt_cocoaModifiers2QtModifiers(ulong modifierFlags)
return qtMods;
}
+Qt::KeyboardModifiers qt_cocoaDragOperation2QtModifiers(uint dragOperations)
+{
+ Qt::KeyboardModifiers qtMods =Qt::NoModifier;
+ if (dragOperations & NSDragOperationLink)
+ qtMods |= Qt::MetaModifier;
+ if (dragOperations & NSDragOperationGeneric)
+ qtMods |= Qt::ControlModifier;
+ if (dragOperations & NSDragOperationCopy)
+ qtMods |= Qt::AltModifier;
+ return qtMods;
+}
+
static inline QEvent::Type cocoaEvent2QtEvent(NSUInteger eventType)
{
// Handle the trivial cases that can be determined from the type.