Fix drag and drop with createWindowContainer
Forward dnd events to the QWindow, exactly like QQuickWidget would do. This of course requires setting setAcceptDrops(true) on the container widget. Task-number: QTBUG-39213 Change-Id: I8ea49e630b071dc0aacd53f798d9b46b03502365 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
This commit is contained in:
parent
46ebcb6176
commit
75834c2232
@ -295,6 +295,17 @@ bool QWindowContainer::event(QEvent *e)
|
||||
}
|
||||
}
|
||||
break;
|
||||
case QEvent::Drop:
|
||||
case QEvent::DragMove:
|
||||
case QEvent::DragLeave:
|
||||
QCoreApplication::sendEvent(d->window, e);
|
||||
return e->isAccepted();
|
||||
case QEvent::DragEnter:
|
||||
// Don't reject drag events for the entire widget when one
|
||||
// item rejects the drag enter
|
||||
QCoreApplication::sendEvent(d->window, e);
|
||||
e->accept();
|
||||
return true;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user