zty199 4a753259d3 Improve Features
Support downloading files from website directly;
Show DSpinner before webpage loading progress finished.
2020-11-28 04:26:30 +08:00

31 lines
629 B
C++

#ifndef WEBENGINEPAGE_H
#define WEBENGINEPAGE_H
#include <QWebEnginePage>
#include <QWebEngineProfile>
#include <QObject>
#include <QProcess>
class WebEnginePage : public QWebEnginePage
{
public:
WebEnginePage(QObject *parent = nullptr);
protected:
QWebEnginePage *createWindow(WebWindowType type) override;
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();
};
#endif // WEBENGINEPAGE_H