summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2018-04-13 09:01:43 +0200
committerJoerg Bornemann <joerg.bornemann@qt.io>2018-05-29 18:31:35 +0000
commit9f27bfb31acfba49a74a342d9249f24633a7ade2 (patch)
treeb156192def25d688ff924b60f1c8defadd86c351 /src/widgets/kernel
parentdd8e73504edbf71808d6585b7a08daddcdcbf18e (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/kernel')
-rw-r--r--src/widgets/kernel/qapplication.cpp12
-rw-r--r--src/widgets/kernel/qapplication_p.h4
-rw-r--r--src/widgets/kernel/qwidget.cpp10
-rw-r--r--src/widgets/kernel/qwidget.h2
-rw-r--r--src/widgets/kernel/qwidget_p.h4
-rw-r--r--src/widgets/kernel/qwidgetwindow.cpp6
-rw-r--r--src/widgets/kernel/qwidgetwindow_p.h4
-rw-r--r--src/widgets/kernel/qwindowcontainer.cpp2
8 files changed, 23 insertions, 21 deletions
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index 404bebd40c..ba315d4338 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -63,7 +63,9 @@
#include "qtranslator.h"
#include "qvariant.h"
#include "qwidget.h"
-#include "private/qdnd_p.h"
+#if QT_CONFIG(draganddrop)
+#include <private/qdnd_p.h>
+#endif
#include "private/qguiapplication_p.h"
#include "qcolormap.h"
#include "qdebug.h"
@@ -832,7 +834,7 @@ QApplication::~QApplication()
delete QApplicationPrivate::app_style;
QApplicationPrivate::app_style = 0;
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
if (qt_is_gui_used)
delete QDragManager::self();
#endif
@@ -3429,7 +3431,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
break;
#endif
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
case QEvent::DragEnter: {
QWidget* w = static_cast<QWidget *>(receiver);
QDragEnterEvent *dragEvent = static_cast<QDragEnterEvent *>(e);
@@ -4477,7 +4479,7 @@ void QApplicationPrivate::notifyThemeChanged()
qt_init_tooltip_palette();
}
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
void QApplicationPrivate::notifyDragStarted(const QDrag *drag)
{
QGuiApplicationPrivate::notifyDragStarted(drag);
@@ -4488,7 +4490,7 @@ void QApplicationPrivate::notifyDragStarted(const QDrag *drag)
if (qt_button_down && !qt_button_down->inherits("QQuickWidget"))
qt_button_down = nullptr;
}
-#endif // QT_NO_DRAGANDDROP
+#endif // QT_CONFIG(draganddrop)
#ifndef QT_NO_GESTURES
QGestureManager* QGestureManager::instance()
diff --git a/src/widgets/kernel/qapplication_p.h b/src/widgets/kernel/qapplication_p.h
index 019fad3fc3..488ca6cbfd 100644
--- a/src/widgets/kernel/qapplication_p.h
+++ b/src/widgets/kernel/qapplication_p.h
@@ -177,9 +177,9 @@ public:
protected:
void notifyThemeChanged() override;
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
void notifyDragStarted(const QDrag *) override;
-#endif // QT_NO_DRAGANDDROP
+#endif // QT_CONFIG(draganddrop)
public:
static QFont *sys_font;
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index a86834002c..12dab9870a 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -1322,7 +1322,7 @@ void QWidget::create(WId window, bool initializeWindow, bool destroyOldWindow)
<< "Alien?" << !testAttribute(Qt::WA_NativeWindow);
#endif
-#if 0 /* Used to be included in Qt4 for Q_WS_WIN */ && !defined(QT_NO_DRAGANDDROP)
+#if 0 /* Used to be included in Qt4 for Q_WS_WIN */ && QT_CONFIG(draganddrop)
// Unregister the dropsite (if already registered) before we
// re-create the widget with a native window.
if (testAttribute(Qt::WA_WState_Created) && !internalWinId() && testAttribute(Qt::WA_NativeWindow)
@@ -9094,7 +9094,7 @@ bool QWidget::event(QEvent *event)
break;
#endif // QT_NO_CONTEXTMENU
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
case QEvent::Drop:
dropEvent((QDropEvent*) event);
break;
@@ -9976,7 +9976,7 @@ void QWidget::setInputMethodHints(Qt::InputMethodHints hints)
}
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
/*!
\fn void QWidget::dragEnterEvent(QDragEnterEvent *event)
@@ -10045,7 +10045,7 @@ void QWidget::dropEvent(QDropEvent *)
{
}
-#endif // QT_NO_DRAGANDDROP
+#endif // QT_CONFIG(draganddrop)
/*!
\fn void QWidget::showEvent(QShowEvent *event)
@@ -11194,7 +11194,7 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on)
switch (attribute) {
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
case Qt::WA_AcceptDrops: {
if (on && !testAttribute(Qt::WA_DropSiteRegistered))
setAttribute(Qt::WA_DropSiteRegistered, true);
diff --git a/src/widgets/kernel/qwidget.h b/src/widgets/kernel/qwidget.h
index 5087d330ee..9f9f167002 100644
--- a/src/widgets/kernel/qwidget.h
+++ b/src/widgets/kernel/qwidget.h
@@ -636,7 +636,7 @@ protected:
virtual void actionEvent(QActionEvent *event);
#endif
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
virtual void dragEnterEvent(QDragEnterEvent *event);
virtual void dragMoveEvent(QDragMoveEvent *event);
virtual void dragLeaveEvent(QDragLeaveEvent *event);
diff --git a/src/widgets/kernel/qwidget_p.h b/src/widgets/kernel/qwidget_p.h
index a9c73c6a26..e8b550b1cd 100644
--- a/src/widgets/kernel/qwidget_p.h
+++ b/src/widgets/kernel/qwidget_p.h
@@ -268,7 +268,7 @@ struct QWExtra {
// *************************** Platform specific values (bit fields first) **********
#if 0 /* Used to be included in Qt4 for Q_WS_WIN */ // <----------------------------------------------------------- WIN
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
QOleDropTarget *dropTarget; // drop target
QList<QPointer<QWidget> > oleDropWidgets;
#endif
@@ -800,7 +800,7 @@ public:
bool shouldShowMaximizeButton();
void winUpdateIsOpaque();
void reparentChildren();
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
QOleDropTarget *registerOleDnd(QWidget *widget);
void unregisterOleDnd(QWidget *widget, QOleDropTarget *target);
#endif
diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp
index 949076b260..1f3057b008 100644
--- a/src/widgets/kernel/qwidgetwindow.cpp
+++ b/src/widgets/kernel/qwidgetwindow.cpp
@@ -309,7 +309,7 @@ bool QWidgetWindow::event(QEvent *event)
return true;
#endif
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
case QEvent::DragEnter:
case QEvent::DragMove:
handleDragEnterMoveEvent(static_cast<QDragMoveEvent *>(event));
@@ -846,7 +846,7 @@ void QWidgetWindow::handleWheelEvent(QWheelEvent *event)
#endif // QT_CONFIG(wheelevent)
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
void QWidgetWindow::handleDragEnterMoveEvent(QDragMoveEvent *event)
{
@@ -922,7 +922,7 @@ void QWidgetWindow::handleDropEvent(QDropEvent *event)
m_dragTarget = 0;
}
-#endif // QT_NO_DRAGANDDROP
+#endif // QT_CONFIG(draganddrop)
void QWidgetWindow::handleExposeEvent(QExposeEvent *event)
{
diff --git a/src/widgets/kernel/qwidgetwindow_p.h b/src/widgets/kernel/qwidgetwindow_p.h
index d0f1d55c2a..ead099390e 100644
--- a/src/widgets/kernel/qwidgetwindow_p.h
+++ b/src/widgets/kernel/qwidgetwindow_p.h
@@ -95,7 +95,7 @@ protected:
#if QT_CONFIG(wheelevent)
void handleWheelEvent(QWheelEvent *);
#endif
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
void handleDragEnterMoveEvent(QDragMoveEvent *);
void handleDragLeaveEvent(QDragLeaveEvent *);
void handleDropEvent(QDropEvent *);
@@ -132,7 +132,7 @@ private:
QPointer<QWidget> m_widget;
QPointer<QWidget> m_implicit_mouse_grabber;
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
QPointer<QWidget> m_dragTarget;
#endif
};
diff --git a/src/widgets/kernel/qwindowcontainer.cpp b/src/widgets/kernel/qwindowcontainer.cpp
index 097931913e..81916bba90 100644
--- a/src/widgets/kernel/qwindowcontainer.cpp
+++ b/src/widgets/kernel/qwindowcontainer.cpp
@@ -329,7 +329,7 @@ bool QWindowContainer::event(QEvent *e)
}
}
break;
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
case QEvent::Drop:
case QEvent::DragMove:
case QEvent::DragLeave: