summaryrefslogtreecommitdiffstats
path: root/tests/quicktestbrowser
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 /tests/quicktestbrowser
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 'tests/quicktestbrowser')
-rw-r--r--tests/quicktestbrowser/BrowserWindow.qml3
-rw-r--r--tests/quicktestbrowser/DownloadView.qml5
2 files changed, 5 insertions, 3 deletions
diff --git a/tests/quicktestbrowser/BrowserWindow.qml b/tests/quicktestbrowser/BrowserWindow.qml
index 8d61ac590..d438075d8 100644
--- a/tests/quicktestbrowser/BrowserWindow.qml
+++ b/tests/quicktestbrowser/BrowserWindow.qml
@@ -77,9 +77,10 @@ ApplicationWindow {
id: testProfile
storageName: "Test"
httpCacheType: httpDiskCacheEnabled.checked ? WebEngineProfile.DiskHttpCache : WebEngineProfile.MemoryHttpCache;
- onDownloadStarted: {
+ onDownloadRequested: {
downloadView.visible = true
downloadView.append(download)
+ download.accept()
}
}
diff --git a/tests/quicktestbrowser/DownloadView.qml b/tests/quicktestbrowser/DownloadView.qml
index 4475e183f..3367dfc71 100644
--- a/tests/quicktestbrowser/DownloadView.qml
+++ b/tests/quicktestbrowser/DownloadView.qml
@@ -72,11 +72,12 @@ Rectangle {
Rectangle {
id: progressBar
- property int progress: downloadModel.downloads[index] ? downloadModel.downloads[index].progress : 0
+ property real progress: downloadModel.downloads[index]
+ ? downloadModel.downloads[index].receivedBytes / downloadModel.downloads[index].totalBytes : 0
radius: 3
color: width == listView.width ? "green" : "#2b74c7"
- width: listView.width / 100 * progress
+ width: listView.width * progress
height: cancelButton.height
Behavior on width {