#pragma once #include class QLabel; class QProgressBar; class QPushButton; class QWebEngineDownloadRequest; class DownloadWidget : public QFrame { Q_OBJECT public: explicit DownloadWidget(QWebEngineDownloadRequest *downloadReq); bool isCompleted() const; signals: void removeRequested(DownloadWidget *self); private slots: void onDownloadProgress(qint64 received, qint64 total); void onStateChanged(); void onButtonClicked(); private: static QString formatSize(qint64 bytes); QWebEngineDownloadRequest *download; QLabel *filenameLabel; QProgressBar *progressBar; QLabel *statusLabel; QPushButton *button; };