From f36e33a6a568026f123808c7f5c87dace6703f94 Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Thu, 3 May 2018 01:13:38 +0200 Subject: QTBUG-65223 workaround --- BUGS.md | 3 +++ lib/addressbar/addressbar.cpp | 2 +- src/CMakeLists.txt | 4 ++++ src/webengine/webview.cpp | 8 ++++++++ 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/BUGS.md b/BUGS.md index 635b39b..216df96 100644 --- a/BUGS.md +++ b/BUGS.md @@ -32,3 +32,6 @@ prepend '#' to the search. ### databases-incognito in home https://bugreports.qt.io/browse/QTBUG-62957 + +### loadFinished is not always emitted when loading is finished +https://bugreports.qt.io/browse/QTBUG-65223 diff --git a/lib/addressbar/addressbar.cpp b/lib/addressbar/addressbar.cpp index 9b3970d..e8dcc6a 100644 --- a/lib/addressbar/addressbar.cpp +++ b/lib/addressbar/addressbar.cpp @@ -79,7 +79,7 @@ void AddressBar::setView(QWebEngineView *view) view->setFocus(); }); - //progressBar->setValue(view->loadProgress()); + progressBar->setValue(100); progressBarConnection = connect(view, &QWebEngineView::loadProgress, progressBar, &QProgressBar::setValue); } diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5757a6d..0f3d0d5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -59,4 +59,8 @@ target_link_libraries(poi configuration bookmarks downloads) +target_compile_definitions(poi + PRIVATE QTBUG_65223_WORKAROUND +) + install(TARGETS poi RUNTIME DESTINATION bin CONFIGURATIONS Release) diff --git a/src/webengine/webview.cpp b/src/webengine/webview.cpp index b9dfaa7..1dca046 100644 --- a/src/webengine/webview.cpp +++ b/src/webengine/webview.cpp @@ -33,6 +33,14 @@ WebView::WebView(WebProfile *profile, QWidget *parent) m_loaded = true; }); +#if defined(QTBUG_65223_WORKAROUND) + connect(this, &QWebEngineView::loadProgress, this, [this](int progress) { + if(progress == 100) { + emit loadFinished(true); + } + }); +#endif + m_pageMenu = new PageMenu(this); m_toolsMenu = new PageToolsMenu(this); } -- cgit v1.2.1