summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/core/web_contents_adapter.cpp4
-rw-r--r--src/webengine/ui_delegates_manager.cpp5
2 files changed, 9 insertions, 0 deletions
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp
index 53bb55b6a..ff4f09f0e 100644
--- a/src/core/web_contents_adapter.cpp
+++ b/src/core/web_contents_adapter.cpp
@@ -1267,7 +1267,11 @@ bool WebContentsAdapter::handleDropDataFileContents(const content::DropData &dro
}
const QString &fileName = toQt(dropData.file_description_filename);
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0))
const QString &filePath = d->dndTmpDir->filePath(fileName);
+#else
+ const QString &filePath = d->dndTmpDir->path() + QLatin1Char('/') + fileName;
+#endif
QFile file(filePath);
if (!file.open(QIODevice::WriteOnly)) {
qWarning("Cannot write temporary file %s.", qUtf8Printable(filePath));
diff --git a/src/webengine/ui_delegates_manager.cpp b/src/webengine/ui_delegates_manager.cpp
index c9c013d52..24861fd35 100644
--- a/src/webengine/ui_delegates_manager.cpp
+++ b/src/webengine/ui_delegates_manager.cpp
@@ -504,7 +504,12 @@ public:
if (pos.isNull() || !item->contains(pos))
return;
const QPoint oldPos = QCursor::pos();
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 7, 0))
const QPoint globalPos = item->mapToGlobal(QPointF(pos)).toPoint();
+#else
+ const QPoint posInWindow = item->mapToItem(item->window()->contentItem(), QPointF(pos)).toPoint();
+ const QPoint globalPos = item->window()->mapToGlobal(posInWindow);
+#endif
if (oldPos == globalPos)
return;
m_oldCursorPos = oldPos;