From 96202a6fe015ac2548f0304a1d5a92b75e7fe00a Mon Sep 17 00:00:00 2001 From: David Rosca Date: Sat, 24 Dec 2016 12:24:12 +0100 Subject: [PATCH] WebView: Remove custom drag&drop handling QtWebEngine drag&drop now works --- src/lib/webengine/webview.cpp | 24 ------------------------ src/lib/webengine/webview.h | 2 -- 2 files changed, 26 deletions(-) diff --git a/src/lib/webengine/webview.cpp b/src/lib/webengine/webview.cpp index 5431d180d..335b38873 100644 --- a/src/lib/webengine/webview.cpp +++ b/src/lib/webengine/webview.cpp @@ -588,30 +588,6 @@ void WebView::userDefinedOpenUrlInBgTab(const QUrl &url) userDefinedOpenUrlInNewTab(actionUrl, true); } -void WebView::dragEnterEvent(QDragEnterEvent *event) -{ - if (event->mimeData()->hasUrls()) { - event->accept(); - return; - } - - QWebEngineView::dragEnterEvent(event); -} - -void WebView::dropEvent(QDropEvent *event) -{ - if (event->mimeData()->hasUrls()) { - const QList &urls = event->mimeData()->urls(); - load(urls.at(0)); - for (int i = 1; i < urls.size(); ++i) { - openUrlInNewTab(urls.at(i), Qz::NT_CleanSelectedTab); - } - return; - } - - QWebEngineView::dropEvent(event); -} - void WebView::createContextMenu(QMenu *menu, const WebHitTestResult &hitTest) { // cppcheck-suppress variableScope diff --git a/src/lib/webengine/webview.h b/src/lib/webengine/webview.h index 8f05ddc14..59eca11af 100644 --- a/src/lib/webengine/webview.h +++ b/src/lib/webengine/webview.h @@ -137,8 +137,6 @@ protected slots: void userDefinedOpenUrlInBgTab(const QUrl &url = QUrl()); protected: - void dragEnterEvent(QDragEnterEvent *event); - void dropEvent(QDropEvent *event); void resizeEvent(QResizeEvent *event); void contextMenuEvent(QContextMenuEvent *event);