diff options
author | Allan Sandfeld Jensen <allan.jensen@digia.com> | 2014-08-18 14:13:44 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@digia.com> | 2014-08-20 10:11:37 +0200 |
commit | 1bae226076b37ba925bf810639e1674130ad622a (patch) | |
tree | f9f6156d5a110e3fa20ed6c010993ff3215330e7 /src | |
parent | 97384030efd6465de42e786779cf80b309e763e3 (diff) |
Make QWindowContainer handle drag'n'drop
Drag'n'drop events were not propagated by a the QWindowContainer to the
embedded QWindow. This patch makes the widget accept the events and
pass them on
Task-number: QTBUG-40603
Change-Id: I97320fbcad27f7c6aa48c95c90bb42dda634764e
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/kernel/qwindow.h | 2 | ||||
-rw-r--r-- | src/widgets/kernel/qwindowcontainer.cpp | 8 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/gui/kernel/qwindow.h b/src/gui/kernel/qwindow.h index 0d13cfa648..40bfad908f 100644 --- a/src/gui/kernel/qwindow.h +++ b/src/gui/kernel/qwindow.h @@ -85,6 +85,7 @@ class QPlatformWindow; class QBackingStore; class QScreen; class QAccessibleInterface; +class QWindowContainer; class Q_GUI_EXPORT QWindow : public QObject, public QSurface { @@ -359,6 +360,7 @@ private: friend class QGuiApplication; friend class QGuiApplicationPrivate; + friend class QWindowContainer; friend Q_GUI_EXPORT QWindowPrivate *qt_window_private(QWindow *window); }; diff --git a/src/widgets/kernel/qwindowcontainer.cpp b/src/widgets/kernel/qwindowcontainer.cpp index dc35dee1a9..206a265761 100644 --- a/src/widgets/kernel/qwindowcontainer.cpp +++ b/src/widgets/kernel/qwindowcontainer.cpp @@ -206,6 +206,7 @@ QWindowContainer::QWindowContainer(QWindow *embeddedWindow, QWidget *parent, Qt: d->window = embeddedWindow; d->window->setParent(&d->fakeParent); + setAcceptDrops(true); connect(QGuiApplication::instance(), SIGNAL(focusWindowChanged(QWindow*)), this, SLOT(focusWindowChanged(QWindow*))); } @@ -298,6 +299,13 @@ bool QWindowContainer::event(QEvent *e) } } break; +#ifndef QT_NO_DRAGANDDROP + case QEvent::Drop: + case QEvent::DragEnter: + case QEvent::DragMove: + case QEvent::DragLeave: + return d->window->event(e); +#endif default: break; } |