diff options
author | Laszlo Agocs <laszlo.agocs@digia.com> | 2014-09-15 15:44:28 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2014-09-15 18:57:35 +0200 |
commit | 75834c223295b6b0e335521370c7c9a6cdca5664 (patch) | |
tree | ad6c039f91786bbd4a610eda1b3c58013d2f86c8 /src/widgets/kernel/qwindowcontainer.cpp | |
parent | 46ebcb6176c25c294c5edbeaaa757fe0ce53903e (diff) |
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>
Diffstat (limited to 'src/widgets/kernel/qwindowcontainer.cpp')
-rw-r--r-- | src/widgets/kernel/qwindowcontainer.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/widgets/kernel/qwindowcontainer.cpp b/src/widgets/kernel/qwindowcontainer.cpp index 1770e60c2e..fa906a5aa2 100644 --- a/src/widgets/kernel/qwindowcontainer.cpp +++ b/src/widgets/kernel/qwindowcontainer.cpp @@ -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; } |