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/dialogs/qcolordialog.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/dialogs/qcolordialog.cpp')
-rw-r--r-- | src/widgets/dialogs/qcolordialog.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/widgets/dialogs/qcolordialog.cpp b/src/widgets/dialogs/qcolordialog.cpp index cf1119254b..99946d341d 100644 --- a/src/widgets/dialogs/qcolordialog.cpp +++ b/src/widgets/dialogs/qcolordialog.cpp @@ -45,7 +45,9 @@ #include "qdrawutil.h" #include "qevent.h" #include "qimage.h" -#include "qdrag.h" +#if QT_CONFIG(draganddrop) +#include <qdrag.h> +#endif #include "qlabel.h" #include "qlayout.h" #include "qlineedit.h" @@ -592,7 +594,7 @@ protected: void mousePressEvent(QMouseEvent *e) override; void mouseMoveEvent(QMouseEvent *e) override; void mouseReleaseEvent(QMouseEvent *e) override; -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) void dragEnterEvent(QDragEnterEvent *e) override; void dragLeaveEvent(QDragLeaveEvent *e) override; void dragMoveEvent(QDragMoveEvent *e) override; @@ -624,7 +626,7 @@ void QColorWell::mousePressEvent(QMouseEvent *e) void QColorWell::mouseMoveEvent(QMouseEvent *e) { QWellArray::mouseMoveEvent(e); -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) if (!mousePressed) return; if ((pressPos - e->pos()).manhattanLength() > QApplication::startDragDistance()) { @@ -647,7 +649,7 @@ void QColorWell::mouseMoveEvent(QMouseEvent *e) #endif } -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) void QColorWell::dragEnterEvent(QDragEnterEvent *e) { if (qvariant_cast<QColor>(e->mimeData()->colorData()).isValid()) @@ -684,7 +686,7 @@ void QColorWell::dropEvent(QDropEvent *e) } } -#endif // QT_NO_DRAGANDDROP +#endif // QT_CONFIG(draganddrop) void QColorWell::mouseReleaseEvent(QMouseEvent *e) { @@ -1072,7 +1074,7 @@ protected: void mousePressEvent(QMouseEvent *e) override; void mouseMoveEvent(QMouseEvent *e) override; void mouseReleaseEvent(QMouseEvent *e) override; -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) void dragEnterEvent(QDragEnterEvent *e) override; void dragLeaveEvent(QDragLeaveEvent *e) override; void dropEvent(QDropEvent *e) override; @@ -1110,7 +1112,7 @@ void QColorShowLabel::mousePressEvent(QMouseEvent *e) void QColorShowLabel::mouseMoveEvent(QMouseEvent *e) { -#ifdef QT_NO_DRAGANDDROP +#if !QT_CONFIG(draganddrop) Q_UNUSED(e); #else if (!mousePressed) @@ -1132,7 +1134,7 @@ void QColorShowLabel::mouseMoveEvent(QMouseEvent *e) #endif } -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) void QColorShowLabel::dragEnterEvent(QDragEnterEvent *e) { if (qvariant_cast<QColor>(e->mimeData()->colorData()).isValid()) @@ -1157,7 +1159,7 @@ void QColorShowLabel::dropEvent(QDropEvent *e) e->ignore(); } } -#endif // QT_NO_DRAGANDDROP +#endif // QT_CONFIG(draganddrop) void QColorShowLabel::mouseReleaseEvent(QMouseEvent *) { |