diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2018-04-13 09:01:43 +0200 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@qt.io> | 2018-05-29 18:31:35 +0000 |
commit | 9f27bfb31acfba49a74a342d9249f24633a7ade2 (patch) | |
tree | b156192def25d688ff924b60f1c8defadd86c351 /src/widgets/widgets/qlineedit.cpp | |
parent | dd8e73504edbf71808d6585b7a08daddcdcbf18e (diff) |
Make sure we can build with -no-feature-draganddrop
We move QInternalMimeData to a separate file, because this class is
used, even if draganddrop is disabled. From now on, include
qinternalmimedata_p.h instead of qdnd_p.h for QInternalMimeData.
Change-Id: I594e08e2e90d574dc445119091686b4b69e4731b
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
Diffstat (limited to 'src/widgets/widgets/qlineedit.cpp')
-rw-r--r-- | src/widgets/widgets/qlineedit.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/widgets/widgets/qlineedit.cpp b/src/widgets/widgets/qlineedit.cpp index bdeef7cdf7..ca6aacc16c 100644 --- a/src/widgets/widgets/qlineedit.cpp +++ b/src/widgets/widgets/qlineedit.cpp @@ -43,7 +43,9 @@ #include "qaction.h" #include "qapplication.h" #include "qclipboard.h" -#include "qdrag.h" +#if QT_CONFIG(draganddrop) +#include <qdrag.h> +#endif #include "qdrawutil.h" #include "qevent.h" #include "qfontmetrics.h" @@ -1427,7 +1429,7 @@ bool QLineEdit::event(QEvent * e) // ### Qt6: move to timerEvent, is here for binary compatibility int timerId = ((QTimerEvent*)e)->timerId(); if (false) { -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) } else if (timerId == d->dndTimer.timerId()) { d->drag(); #endif @@ -1515,7 +1517,7 @@ void QLineEdit::mousePressEvent(QMouseEvent* e) mark = mark && (d->imHints & Qt::ImhNoPredictiveText); #endif // Q_OS_ANDROID int cursor = d->xToPos(e->pos().x()); -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) if (!mark && d->dragEnabled && d->control->echoMode() == Normal && e->button() == Qt::LeftButton && d->inSelection(e->pos().x())) { if (!d->dndTimer.isActive()) @@ -1534,7 +1536,7 @@ void QLineEdit::mouseMoveEvent(QMouseEvent * e) Q_D(QLineEdit); if (e->buttons() & Qt::LeftButton) { -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) if (d->dndTimer.isActive()) { if ((d->mousePressPos - e->pos()).manhattanLength() > QApplication::startDragDistance()) d->drag(); @@ -1581,7 +1583,7 @@ void QLineEdit::mouseReleaseEvent(QMouseEvent* e) Q_D(QLineEdit); if (d->sendMouseEventToInputContext(e)) return; -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) if (e->button() == Qt::LeftButton) { if (d->dndTimer.isActive()) { d->dndTimer.stop(); @@ -2031,7 +2033,7 @@ void QLineEdit::paintEvent(QPaintEvent *) } -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) /*!\reimp */ void QLineEdit::dragMoveEvent(QDragMoveEvent *e) @@ -2096,7 +2098,7 @@ void QLineEdit::dropEvent(QDropEvent* e) } } -#endif // QT_NO_DRAGANDDROP +#endif // QT_CONFIG(draganddrop) #ifndef QT_NO_CONTEXTMENU /*! |