mirror of
https://gitee.com/spark-store-project/spark-web-app-runtime.git
synced 2025-09-23 03:32:22 +08:00
Support downloading files from website directly; Show DSpinner before webpage loading progress finished.
31 lines
629 B
C++
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
|