summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2018-04-13 10:10:03 +0200
committerKai Koehne <kai.koehne@qt.io>2018-04-17 15:20:44 +0000
commit7566b23f7d4df9898369a9608b000c0364221177 (patch)
treee4b4435a3c955c682e7da69014b4b3539d198ab1 /src
parent780e8c985b384e7a3b4986075fcb88d50d6fe266 (diff)
Make sure we can build with -no-feature-draganddrop
Change-Id: Ib6763a8a3e1ac1ac98caef39f7e6e75c18344424 Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/core/web_contents_adapter.cpp2
-rw-r--r--src/core/web_contents_adapter.h3
-rw-r--r--src/core/web_contents_view_qt.cpp4
-rw-r--r--src/webengine/api/qquickwebengineview.cpp9
-rw-r--r--src/webengine/api/qquickwebengineview_p.h2
-rw-r--r--src/webenginewidgets/api/qwebenginepage.cpp7
-rw-r--r--src/webenginewidgets/api/qwebengineview.cpp2
-rw-r--r--src/webenginewidgets/api/qwebengineview.h2
8 files changed, 31 insertions, 0 deletions
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp
index 900abac44..4ebed8fc9 100644
--- a/src/core/web_contents_adapter.cpp
+++ b/src/core/web_contents_adapter.cpp
@@ -1375,6 +1375,7 @@ void WebContentsAdapter::setWebChannel(QWebChannel *channel, uint worldId)
channel->connectTo(d->webChannelTransport.get());
}
+#if QT_CONFIG(draganddrop)
static QMimeData *mimeDataFromDropData(const content::DropData &dropData)
{
QMimeData *mimeData = new QMimeData();
@@ -1635,6 +1636,7 @@ void WebContentsAdapter::leaveDrag()
rvh->GetWidget()->DragTargetDragLeave(d->lastDragClientPos, d->lastDragScreenPos);
d->currentDropData.reset();
}
+#endif // QT_CONFIG(draganddrop)
void WebContentsAdapter::replaceMisspelling(const QString &word)
{
diff --git a/src/core/web_contents_adapter.h b/src/core/web_contents_adapter.h
index f42dea394..111100bba 100644
--- a/src/core/web_contents_adapter.h
+++ b/src/core/web_contents_adapter.h
@@ -42,6 +42,7 @@
#include "qtwebenginecoreglobal.h"
#include "web_contents_adapter_client.h"
+#include <QtGui/qtgui-config.h>
#include <QtWebEngineCore/qwebenginehttprequest.h>
#include <QScopedPointer>
@@ -181,6 +182,7 @@ public:
QPointF lastScrollOffset() const;
QSizeF lastContentsSize() const;
+#if QT_CONFIG(draganddrop)
void startDragging(QObject *dragSource, const content::DropData &dropData,
Qt::DropActions allowedActions, const QPixmap &pixmap, const QPoint &offset);
void enterDrag(QDragEnterEvent *e, const QPointF &screenPos);
@@ -188,6 +190,7 @@ public:
void updateDragAction(int action);
void endDragging(const QPointF &clientPos, const QPointF &screenPos);
void leaveDrag();
+#endif // QT_CONFIG(draganddrop)
void printToPDF(const QPageLayout&, const QString&);
quint64 printToPDFCallbackResult(const QPageLayout &,
bool colorMode = true,
diff --git a/src/core/web_contents_view_qt.cpp b/src/core/web_contents_view_qt.cpp
index 1e7e718da..a7895d61c 100644
--- a/src/core/web_contents_view_qt.cpp
+++ b/src/core/web_contents_view_qt.cpp
@@ -229,6 +229,7 @@ void WebContentsViewQt::StartDragging(const content::DropData &drop_data,
const content::DragEventSourceInfo &event_info,
content::RenderWidgetHostImpl* source_rwh)
{
+#if QT_CONFIG(draganddrop)
Q_UNUSED(event_info);
QPixmap pixmap;
@@ -240,11 +241,14 @@ void WebContentsViewQt::StartDragging(const content::DropData &drop_data,
}
m_client->startDragging(drop_data, toQtDropActions(allowed_ops), pixmap, hotspot);
+#endif // QT_CONFIG(draganddrop)
}
void WebContentsViewQt::UpdateDragCursor(blink::WebDragOperation dragOperation)
{
+#if QT_CONFIG(draganddrop)
m_client->webContentsAdapter()->updateDragAction(dragOperation);
+#endif // QT_CONFIG(draganddrop)
}
void WebContentsViewQt::TakeFocus(bool reverse)
diff --git a/src/webengine/api/qquickwebengineview.cpp b/src/webengine/api/qquickwebengineview.cpp
index 334def6c4..fde7b40dc 100644
--- a/src/webengine/api/qquickwebengineview.cpp
+++ b/src/webengine/api/qquickwebengineview.cpp
@@ -1002,7 +1002,14 @@ void QQuickWebEngineViewPrivate::startDragging(const content::DropData &dropData
Qt::DropActions allowedActions,
const QPixmap &pixmap, const QPoint &offset)
{
+#if !QT_CONFIG(draganddrop)
+ Q_UNUSED(dropData);
+ Q_UNUSED(allowedActions);
+ Q_UNUSED(pixmap);
+ Q_UNUSED(offset);
+#else
adapter->startDragging(q_ptr->window(), dropData, allowedActions, pixmap, offset);
+#endif // QT_CONFIG(draganddrop)
}
bool QQuickWebEngineViewPrivate::isEnabled() const
@@ -1364,6 +1371,7 @@ void QQuickWebEngineView::itemChange(ItemChange change, const ItemChangeData &va
QQuickItem::itemChange(change, value);
}
+#if QT_CONFIG(draganddrop)
static QPoint mapToScreen(const QQuickItem *item, const QPoint &clientPos)
{
return item->window()->position() + item->mapToScene(clientPos).toPoint();
@@ -1401,6 +1409,7 @@ void QQuickWebEngineView::dropEvent(QDropEvent *e)
e->accept();
d->adapter->endDragging(e->pos(), mapToScreen(this, e->pos()));
}
+#endif // QT_CONFIG(draganddrop)
void QQuickWebEngineView::triggerWebAction(WebAction action)
{
diff --git a/src/webengine/api/qquickwebengineview_p.h b/src/webengine/api/qquickwebengineview_p.h
index 53d7facd3..8d20740e6 100644
--- a/src/webengine/api/qquickwebengineview_p.h
+++ b/src/webengine/api/qquickwebengineview_p.h
@@ -554,10 +554,12 @@ Q_SIGNALS:
protected:
void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) override;
void itemChange(ItemChange, const ItemChangeData &) override;
+#if QT_CONFIG(draganddrop)
void dragEnterEvent(QDragEnterEvent *e) override;
void dragLeaveEvent(QDragLeaveEvent *e) override;
void dragMoveEvent(QDragMoveEvent *e) override;
void dropEvent(QDropEvent *e) override;
+#endif // QT_CONFIG(draganddrop)
private:
Q_DECLARE_PRIVATE(QQuickWebEngineView)
diff --git a/src/webenginewidgets/api/qwebenginepage.cpp b/src/webenginewidgets/api/qwebenginepage.cpp
index a8a860f16..8911c63c8 100644
--- a/src/webenginewidgets/api/qwebenginepage.cpp
+++ b/src/webenginewidgets/api/qwebenginepage.cpp
@@ -1663,7 +1663,14 @@ void QWebEnginePagePrivate::startDragging(const content::DropData &dropData,
Qt::DropActions allowedActions, const QPixmap &pixmap,
const QPoint &offset)
{
+#if !QT_CONFIG(draganddrop)
+ Q_UNUSED(dropData);
+ Q_UNUSED(allowedActions);
+ Q_UNUSED(pixmap);
+ Q_UNUSED(offset);
+#else
adapter->startDragging(view, dropData, allowedActions, pixmap, offset);
+#endif // QT_CONFIG(draganddrop)
}
bool QWebEnginePagePrivate::isEnabled() const
diff --git a/src/webenginewidgets/api/qwebengineview.cpp b/src/webenginewidgets/api/qwebengineview.cpp
index 649ccb938..80c60e1a8 100644
--- a/src/webenginewidgets/api/qwebengineview.cpp
+++ b/src/webenginewidgets/api/qwebengineview.cpp
@@ -362,6 +362,7 @@ void QWebEngineView::hideEvent(QHideEvent *event)
page()->d_ptr->wasHidden();
}
+#if QT_CONFIG(draganddrop)
/*!
\reimp
*/
@@ -418,6 +419,7 @@ void QWebEngineView::dropEvent(QDropEvent *e)
d->page->d_ptr->adapter->endDragging(e->pos(), mapToGlobal(e->pos()));
d->m_dragEntered = false;
}
+#endif // QT_CONFIG(draganddrop)
#ifndef QT_NO_ACCESSIBILITY
int QWebEngineViewAccessible::childCount() const
diff --git a/src/webenginewidgets/api/qwebengineview.h b/src/webenginewidgets/api/qwebengineview.h
index 6abbc1342..77d26b8ec 100644
--- a/src/webenginewidgets/api/qwebengineview.h
+++ b/src/webenginewidgets/api/qwebengineview.h
@@ -124,10 +124,12 @@ protected:
bool event(QEvent*) override;
void showEvent(QShowEvent *) override;
void hideEvent(QHideEvent *) override;
+#if QT_CONFIG(draganddrop)
void dragEnterEvent(QDragEnterEvent *e) override;
void dragLeaveEvent(QDragLeaveEvent *e) override;
void dragMoveEvent(QDragMoveEvent *e) override;
void dropEvent(QDropEvent *e) override;
+#endif // QT_CONFIG(draganddrop)
private:
Q_DISABLE_COPY(QWebEngineView)