From c3a426a26420599904d9aa9b1407693a7df6e5da Mon Sep 17 00:00:00 2001 From: Martchus Date: Tue, 5 Dec 2023 12:34:22 +0100 Subject: [PATCH] Fix compatibility with Qt 5 in web view code --- syncthingwidgets/webview/webpage.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/syncthingwidgets/webview/webpage.cpp b/syncthingwidgets/webview/webpage.cpp index 1bab395..6547df2 100644 --- a/syncthingwidgets/webview/webpage.cpp +++ b/syncthingwidgets/webview/webpage.cpp @@ -186,7 +186,11 @@ void WebPage::insertStyleSheet(const QString &name, const QString &cssCode, bool script.setRunsOnSubFrames(true); script.setWorldId(QWebEngineScript::ApplicationWorld); auto &sc = scripts(); +#if (QTWEBENGINEWIDGETS_VERSION >= QT_VERSION_CHECK(6, 0, 0)) auto existingScripts = sc.find(name); +#else + auto existingScripts = sc.findScripts(name); +#endif for (const auto &existingScript : existingScripts) { sc.remove(existingScript); sc.remove(existingScript);