Improve Features

Support downloading files from website directly;
Show DSpinner before webpage loading progress finished.
This commit is contained in:
2020-11-28 04:14:04 +08:00
parent 9c8b2fdd94
commit 4a753259d3
12 changed files with 166 additions and 152 deletions

View File

@@ -2,7 +2,9 @@
#define WEBENGINEPAGE_H
#include <QWebEnginePage>
#include <QWebEngineProfile>
#include <QObject>
#include <QProcess>
class WebEnginePage : public QWebEnginePage
{
@@ -12,8 +14,16 @@ public:
protected:
QWebEnginePage *createWindow(WebWindowType type) override;
public slots:
void onUrlChanged(const QUrl);
private:
QWebEngineProfile *m_profile;
QProcess *process;
private slots:
void on_urlChanged(const QUrl url);
void on_download(QWebEngineDownloadItem *item);
void on_downloadProgress(qint64 bytesReceived, qint64 bytesTotal);
void on_downloadFinished();
};