Skip to content

Commit

Permalink
Fix compatibility with Qt 5 in web view code
Browse files Browse the repository at this point in the history
  • Loading branch information
Martchus committed Dec 5, 2023
1 parent d327daa commit c3a426a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions syncthingwidgets/webview/webpage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c3a426a

Please sign in to comment.