aboutsummaryrefslogtreecommitdiff
path: root/src/webengine/webview.cpp
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2018-01-19 02:10:31 +0100
committerAqua-sama <aqua@iserlohn-fortress.net>2018-01-19 02:10:31 +0100
commit49ee5ed6e80b8f06337f92d14e2cab1c1512c1e3 (patch)
treee35d5472c2a3ed129f5a6a6826f9999b033cc548 /src/webengine/webview.cpp
parentConfiguration creates missing items based on defaults (diff)
downloadsmolbote-49ee5ed6e80b8f06337f92d14e2cab1c1512c1e3.tar.xz
Refactoring MainWindow
- Added NavigationBar object that manages the navigation buttons - Removed NavigationButton class that it obsoleted
Diffstat (limited to 'src/webengine/webview.cpp')
-rw-r--r--src/webengine/webview.cpp23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/webengine/webview.cpp b/src/webengine/webview.cpp
index ea0ee26..c924144 100644
--- a/src/webengine/webview.cpp
+++ b/src/webengine/webview.cpp
@@ -26,7 +26,7 @@
#include <QPrinter>
#include <QPrinterInfo>
-#include "mainwindow.h"
+#include "src/mainwindow/mainwindow.h"
#include <QStatusBar>
// ssl errors
@@ -38,6 +38,17 @@ WebView::WebView(MainWindow *parentMainWindow, QWidget *parent)
Q_CHECK_PTR(parentMainWindow);
m_parent = parentMainWindow;
+ // load status and progress
+ connect(this, &QWebEngineView::loadStarted, this, [this]() {
+ m_loaded = false;
+ });
+ connect(this, &QWebEngineView::loadFinished, this, [this]() {
+ m_loaded = true;
+ });
+ connect(this, &QWebEngineView::loadProgress, this, [this](int progress) {
+ m_loadProgress = progress;
+ });
+
m_pageMenu = new QMenu();
m_pageMenu->setMinimumWidth(240);
@@ -137,6 +148,16 @@ void WebView::setPage(WebPage *page)
QWebEngineView::setPage(page);
}
+bool WebView::isLoaded() const
+{
+ return m_loaded;
+}
+
+int WebView::loadProgress() const
+{
+ return m_loadProgress;
+}
+
WebView *WebView::createWindow(QWebEnginePage::WebWindowType type)
{
WebView *view = new WebView(m_parent);