diff options
author | Morten Johan Sørvig <morten.sorvig@digia.com> | 2014-02-14 14:58:32 +0100 |
---|---|---|
committer | Morten Johan Sørvig <morten.sorvig@digia.com> | 2014-10-22 23:31:35 +0200 |
commit | ad66fa0dc18f20f3ceb5916ac791231c067b5898 (patch) | |
tree | 109ff0edcdc62e445478de38ec52f113e73767fe /src/plugins/platforms/cocoa/qcocoadrag.mm | |
parent | 449b62ed436a8e45d1064b76dc9cc3201966bd91 (diff) |
Cocoa: Delay QMimeData requests for DnD events.
We were delaying the conversion from Qt to OS X types,
but not the data request to the application.
Introduce "Eager" and "Lazy" pasteboard promises:
Eager promises request the application data immediately
and can continue to use the existing commit-promises-
on-app-exit logic. Eager promises are the default
type and will be used for copy/paste.
Lazy promises delay requesting the data from the application
for as long as possible, specifically until when
promiseKeeper() is called. Lazy promises are used for
drag-and-drop and are not committed on application
exit.
This brings OS X DnD behavior in line with the
Windows behavior.
[ChangeLog][OS X] Drag-and-drop QMimeData requests are
now delayed until drop time.
Task-number: QTBUG-31301
Change-Id: I8ddbba41593251f4c0c49c29492dce990066e20d
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoadrag.mm')
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoadrag.mm | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoadrag.mm b/src/plugins/platforms/cocoa/qcocoadrag.mm index 2c8d391d2b..47b52c9fdd 100644 --- a/src/plugins/platforms/cocoa/qcocoadrag.mm +++ b/src/plugins/platforms/cocoa/qcocoadrag.mm @@ -132,7 +132,7 @@ Qt::DropAction QCocoaDrag::drag(QDrag *o) QMacPasteboard dragBoard((CFStringRef) NSDragPboard, QMacInternalPasteboardMime::MIME_DND); m_drag->mimeData()->setData(QLatin1String("application/x-qt-mime-type-name"), QByteArray("dummy")); - dragBoard.setMimeData(m_drag->mimeData()); + dragBoard.setMimeData(m_drag->mimeData(), QMacPasteboard::LazyRequest); NSPoint event_location = [m_lastEvent locationInWindow]; NSPoint local_point = [m_lastView convertPoint:event_location fromView:nil]; |