diff options
Diffstat (limited to 'src/mainwindow/widgets/loadingbar.cpp')
-rw-r--r-- | src/mainwindow/widgets/loadingbar.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mainwindow/widgets/loadingbar.cpp b/src/mainwindow/widgets/loadingbar.cpp index 2c12371..76eafc4 100644 --- a/src/mainwindow/widgets/loadingbar.cpp +++ b/src/mainwindow/widgets/loadingbar.cpp @@ -22,6 +22,7 @@ void LoadingBar::connectWebView(WebView *view) disconnect(loadStartedConnection); disconnect(loadProgressConnection); + disconnect(loadedConnection); disconnect(loadFinishedConnection); if(view->isLoaded()) { @@ -33,6 +34,9 @@ void LoadingBar::connectWebView(WebView *view) loadStartedConnection = connect(view, &QWebEngineView::loadStarted, this, &LoadingBar::loadStarted); loadProgressConnection = connect(view, &QWebEngineView::loadProgress, this, &QProgressBar::setValue); + loadedConnection = connect(view, &WebView::loaded, this, [this]() { + QTimer::singleShot(2000, this, &LoadingBar::hide); + }); loadFinishedConnection = connect(view, &QWebEngineView::loadFinished, this, &LoadingBar::loadFinished); } @@ -46,5 +50,4 @@ void LoadingBar::loadStarted() void LoadingBar::loadFinished(bool ok) { setFormat(QString("%p% %1").arg(ok ? tr("Finished") : tr("Failed"))); - QTimer::singleShot(2000, this, SLOT(hide())); } |