diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -85,6 +85,8 @@ add_definitions(-D_WIN32_WINNT=${ver}) endif() +set(HAVE_QTWEBENGINE_5_10 NOT Qt5WebEngineWidgets_VERSION VERSION_LESS 5.10.0) + # Mandatory: OpenSSL find_package(OpenSSL REQUIRED) diff --git a/config.h.cmake b/config.h.cmake --- a/config.h.cmake +++ b/config.h.cmake @@ -9,3 +9,6 @@ /* Disable DBus support */ #cmakedefine DISABLE_DBUS + +/* QtWebEngine is at least version 5.10 */ +#cmakedefine01 HAVE_QTWEBENGINE_5_10 diff --git a/src/lib/webengine/webview.cpp b/src/lib/webengine/webview.cpp --- a/src/lib/webengine/webview.cpp +++ b/src/lib/webengine/webview.cpp @@ -495,7 +495,7 @@ void WebView::savePageAs() { -#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0) +#if HAVE_QTWEBENGINE_5_10 page()->runJavaScript(QSL("document.contentType"), WebPage::SafeJsWorld, [this](const QVariant &res) { const QSet webPageTypes = { QSL("text/html"),