aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2018-05-03 01:13:38 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2018-05-03 01:13:38 +0200
commitf36e33a6a568026f123808c7f5c87dace6703f94 (patch)
tree1c77067c320ead831bd7bba6c59d56a94fe8216f
parentClean up WebView (diff)
downloadsmolbote-f36e33a6a568026f123808c7f5c87dace6703f94.tar.xz
QTBUG-65223 workaround
-rw-r--r--BUGS.md3
-rw-r--r--lib/addressbar/addressbar.cpp2
-rw-r--r--src/CMakeLists.txt4
-rw-r--r--src/webengine/webview.cpp8
4 files changed, 16 insertions, 1 deletions
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);
}