diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2019-05-23 11:16:23 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2019-05-23 09:33:53 +0000 |
commit | 2f24150b03a8141b3e64442bcfcc08448b9a79e5 (patch) | |
tree | d742b17e50d24b82f7e5e58a04abf6c7a73cb4c2 /src/quickwidgets | |
parent | c8c2db3f5b157131542025ce556d248c7a916a00 (diff) |
Add a feature for Drag&Drop support in Qt Quick
Even if we have drag&drop in QtGui we don't necessarily want it in
QtQuick. Also, since the QQuickDropArea needs QRegularExpression,
quick-draganddrop needs to depend on regularexpression.
Change-Id: I623e910178160ad3e3af3c01c96c30e88dc1b7ba
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/quickwidgets')
-rw-r--r-- | src/quickwidgets/qquickwidget.cpp | 6 | ||||
-rw-r--r-- | src/quickwidgets/qquickwidget.h | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/quickwidgets/qquickwidget.cpp b/src/quickwidgets/qquickwidget.cpp index f1a0f0c863..6970553fc6 100644 --- a/src/quickwidgets/qquickwidget.cpp +++ b/src/quickwidgets/qquickwidget.cpp @@ -129,7 +129,7 @@ void QQuickWidgetPrivate::init(QQmlEngine* e) if (!engine.isNull() && !engine.data()->incubationController()) engine.data()->setIncubationController(offscreenWindow->incubationController()); -#if QT_CONFIG(draganddrop) +#if QT_CONFIG(quick_draganddrop) q->setAcceptDrops(true); #endif @@ -1530,7 +1530,7 @@ bool QQuickWidget::event(QEvent *e) return QWidget::event(e); } -#if QT_CONFIG(draganddrop) +#if QT_CONFIG(quick_draganddrop) /*! \reimp */ void QQuickWidget::dragEnterEvent(QDragEnterEvent *e) @@ -1565,7 +1565,7 @@ void QQuickWidget::dropEvent(QDropEvent *e) d->offscreenWindow->event(e); } -#endif // draganddrop +#endif // quick_draganddrop // TODO: try to separate the two cases of // 1. render() unconditionally without sync diff --git a/src/quickwidgets/qquickwidget.h b/src/quickwidgets/qquickwidget.h index 5543705f13..1ceb7449b3 100644 --- a/src/quickwidgets/qquickwidget.h +++ b/src/quickwidgets/qquickwidget.h @@ -134,7 +134,7 @@ protected: void wheelEvent(QWheelEvent *) override; #endif -#if QT_CONFIG(draganddrop) +#if QT_CONFIG(quick_draganddrop) void dragEnterEvent(QDragEnterEvent *) override; void dragMoveEvent(QDragMoveEvent *) override; void dragLeaveEvent(QDragLeaveEvent *) override; |