summaryrefslogtreecommitdiffstats
path: root/src/webengine/api/qquickwebenginedownloaditem_p.h
diff options
context:
space:
mode:
authorAndras Becsi <andras.becsi@theqtcompany.com>2015-02-03 16:26:44 +0100
committerAndras Becsi <andras.becsi@theqtcompany.com>2015-02-06 12:02:52 +0000
commit22f4a67e434703b400ad9ee669f673144e5f33dc (patch)
treeb66fd7c669309712466487724206126db4f88787 /src/webengine/api/qquickwebenginedownloaditem_p.h
parentdd450a1006c6975014f95dcb93395e961945c4f2 (diff)
Update QML download API to match widgets and add documentation
Rename the download signal to downloadRequested and only start a download if it has been explicitly accepted by the user, else cancel it by default. Replace the downloadPercentage property with totalBytes and receivedBytes to also give the user information about download size. Additionally this patch adds missing documentation. Change-Id: I9d895386cf033f2efffe3ebac6f08f94c6fe0c19 Reviewed-by: Michael BrĂ¼ning <michael.bruning@theqtcompany.com> Reviewed-by: Jocelyn Turcotte <jturcotte@woboq.com>
Diffstat (limited to 'src/webengine/api/qquickwebenginedownloaditem_p.h')
-rw-r--r--src/webengine/api/qquickwebenginedownloaditem_p.h17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/webengine/api/qquickwebenginedownloaditem_p.h b/src/webengine/api/qquickwebenginedownloaditem_p.h
index 2cb140acc..ea12c9c94 100644
--- a/src/webengine/api/qquickwebenginedownloaditem_p.h
+++ b/src/webengine/api/qquickwebenginedownloaditem_p.h
@@ -52,6 +52,7 @@ class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineDownloadItem: public QObject {
public:
~QQuickWebEngineDownloadItem();
enum DownloadState {
+ DownloadRequested,
DownloadInProgress,
DownloadCompleted,
DownloadCancelled,
@@ -61,20 +62,24 @@ public:
Q_PROPERTY(quint32 id READ id() CONSTANT FINAL)
Q_PROPERTY(DownloadState state READ state NOTIFY stateChanged)
- Q_PROPERTY(int progress READ progress NOTIFY progressChanged)
+ Q_PROPERTY(qint64 totalBytes READ totalBytes NOTIFY totalBytesChanged)
+ Q_PROPERTY(qint64 receivedBytes READ receivedBytes NOTIFY receivedBytesChanged)
Q_PROPERTY(QString path READ path WRITE setPath NOTIFY pathChanged)
+ Q_INVOKABLE void accept();
Q_INVOKABLE void cancel();
- quint32 id();
- DownloadState state();
- int progress();
- QString path();
+ quint32 id() const;
+ DownloadState state() const;
+ qint64 totalBytes() const;
+ qint64 receivedBytes() const;
+ QString path() const;
void setPath(QString path);
Q_SIGNALS:
void stateChanged();
- void progressChanged();
+ void receivedBytesChanged();
+ void totalBytesChanged();
void pathChanged();
private: