Skip to content

Commit

Permalink
Use thread-safe setUrlRequestInterceptor in WebPageWindow
Browse files Browse the repository at this point in the history
When Qt version >= 5.13
Fixes #3365
  • Loading branch information
amtriathlon committed Mar 3, 2020
1 parent 10ae178 commit 95c1d82
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Train/WebPageWindow.cpp
Expand Up @@ -146,7 +146,11 @@ WebPageWindow::WebPageWindow(Context *context) : GcChartWindow(context), context

// add a download interceptor
WebDownloadInterceptor *interceptor = new WebDownloadInterceptor;
#if (QT_VERSION >= QT_VERSION_CHECK(5, 13, 0))
view->page()->profile()->setUrlRequestInterceptor(interceptor);
#else
view->page()->profile()->setRequestInterceptor(interceptor);
#endif

// cookies and storage
view->page()->profile()->setPersistentCookiesPolicy(QWebEngineProfile::ForcePersistentCookies);
Expand Down

0 comments on commit 95c1d82

Please sign in to comment.