Drag&Drop support for child items in QQuickWidget

This is a quick-fix. The real issue is that QWidget and QWindow
reacts differently when a QDragEnterEvent is rejected.

Change-Id: I3e3e50610c14acfaada9c1b243b88cfe9eae54b2
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
This commit is contained in:
Paul Olav Tvete 2014-06-10 11:09:21 +02:00 committed by The Qt Project
parent 0a575482d5
commit 906cf6ce32
1 changed files with 6 additions and 1 deletions

View File

@ -1006,13 +1006,18 @@ bool QQuickWidget::event(QEvent *e)
switch (e->type()) {
#ifndef QT_NO_DRAGANDDROP
case QEvent::Drop:
case QEvent::DragEnter:
case QEvent::DragMove:
case QEvent::DragLeave:
// Drag/drop events only have local pos, so no need to map,
// but QQuickWindow::event() does not return true
d->offscreenWindow->event(e);
return e->isAccepted();
case QEvent::DragEnter:
// Don't reject drag events for the entire widget when one
// item rejects the drag enter
d->offscreenWindow->event(e);
e->accept();
return true;
#endif
case QEvent::TouchBegin:
case QEvent::TouchEnd: