Cocoa DND: respect QDropEvent::setDropAction()

Task-number: QTBUG-31061
Change-Id: Id3275a0510bfa619a52d17cf48a3e48b3bae5354
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
bb10
J-P Nurmi 2013-05-08 17:40:35 +02:00 committed by The Qt Project
parent b8a73f96da
commit 00859fe32f
1 changed files with 5 additions and 2 deletions

View File

@ -1331,14 +1331,17 @@ static QTouchDevice *touchDevice = 0;
QCocoaDropData mimeData([sender draggingPasteboard]);
response = QWindowSystemInterface::handleDrop(m_window, &mimeData, qt_windowPoint, qtAllowed);
}
if (response.isAccepted()) {
QCocoaDrag* nativeDrag = static_cast<QCocoaDrag *>(QGuiApplicationPrivate::platformIntegration()->drag());
nativeDrag->setAcceptedAction(response.acceptedAction());
}
return response.isAccepted();
}
- (void)draggedImage:(NSImage*) img endedAt:(NSPoint) point operation:(NSDragOperation) operation
{
Q_UNUSED(img);
QCocoaDrag* nativeDrag = static_cast<QCocoaDrag *>(QGuiApplicationPrivate::platformIntegration()->drag());
nativeDrag->setAcceptedAction(qt_mac_mapNSDragOperation(operation));
Q_UNUSED(operation);
// keep our state, and QGuiApplication state (buttons member) in-sync,
// or future mouse events will be processed incorrectly