Accept subsequent drag moves in QWidgetWindow if enter was accepted.

Add handling similar to QGuiApplicationPrivate::processDrag.

Task-number: QTBUG-28008
Change-Id: I516531da242471cdfbb59418d0052b25f799f373
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
This commit is contained in:
Friedemann Kleint 2012-11-16 10:36:49 +01:00 committed by The Qt Project
parent 11b5c54f55
commit 72a0ce045c

View File

@ -499,6 +499,10 @@ void QWidgetWindow::handleDragEnterMoveEvent(QDragMoveEvent *event)
const QPoint mapped = widget->mapFromGlobal(m_widget->mapToGlobal(event->pos()));
QDragMoveEvent translated(mapped, event->possibleActions(), event->mimeData(), event->mouseButtons(), event->keyboardModifiers());
translated.setDropAction(event->dropAction());
if (event->isAccepted()) { // Handling 'DragEnter' should suffice for the application.
translated.accept();
translated.setDropAction(event->dropAction());
}
QGuiApplication::sendSpontaneousEvent(widget, &translated);
if (translated.isAccepted()) {
event->accept();