From 637beda0062ff65918823147830b52e29ae550a6 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 8 May 2017 14:44:17 +0200 Subject: Fix backwards compatibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QtWebEngine supports building with last stable and last LTS Qt releases. Guard some 5.7-5.9 API from being used when not available, and reinstate the default features for 5.6 LTS builds. Change-Id: Ia288a49109d011a2bee883d4a2d38d994b497d59 Reviewed-by: Michael BrĂ¼ning --- src/webengine/ui_delegates_manager.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/webengine') diff --git a/src/webengine/ui_delegates_manager.cpp b/src/webengine/ui_delegates_manager.cpp index 4a47a49eb..6cc496d5b 100644 --- a/src/webengine/ui_delegates_manager.cpp +++ b/src/webengine/ui_delegates_manager.cpp @@ -50,6 +50,7 @@ #include #include #include +#include #include #include #include @@ -559,7 +560,11 @@ void UIDelegatesManager::showToolTip(const QString &text) int width = QQmlProperty(m_toolTip.data(), QStringLiteral("width")).read().toInt(); QSize toolTipSize(width, height); QPoint position = m_view->cursor().pos(); +#if (QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)) position = m_view->mapFromGlobal(calculateToolTipPosition(position, toolTipSize)).toPoint(); +#else + position = m_view->window()->mapFromGlobal(calculateToolTipPosition(position, toolTipSize)); +#endif QQmlProperty(m_toolTip.data(), QStringLiteral("x")).write(position.x()); QQmlProperty(m_toolTip.data(), QStringLiteral("y")).write(position.y()); -- cgit v1.2.3