diff options
Diffstat (limited to 'src/webengine/webview.cpp')
-rw-r--r-- | src/webengine/webview.cpp | 23 |
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); |