summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2018-08-20 14:35:40 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2018-08-21 06:33:35 +0000
commitec022d0efec47e0e68cdec1c2e018ce864cc015c (patch)
tree4e98ce197a8a2e54c00638770485457656c80684 /examples
parent4b73fc5bd2fd3df10f1e7499c82da08fbd417055 (diff)
Port WorkerScript threading examples to use ES modules
This is the more modern way of doing things, so demonstrate that in our examples and documentation. Change-Id: Icd5316fbeeb00c34d470c8d871851945dc831244 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'examples')
-rw-r--r--examples/quick/threading/doc/src/threading.qdoc4
-rw-r--r--examples/quick/threading/threadedlistmodel/dataloader.mjs (renamed from examples/quick/threading/threadedlistmodel/dataloader.js)0
-rw-r--r--examples/quick/threading/threadedlistmodel/timedisplay.qml2
-rw-r--r--examples/quick/threading/threading.qrc4
-rw-r--r--examples/quick/threading/workerscript/workerscript.mjs (renamed from examples/quick/threading/workerscript/workerscript.js)0
-rw-r--r--examples/quick/threading/workerscript/workerscript.qml2
6 files changed, 6 insertions, 6 deletions
diff --git a/examples/quick/threading/doc/src/threading.qdoc b/examples/quick/threading/doc/src/threading.qdoc
index bbda638f07..f5e5139916 100644
--- a/examples/quick/threading/doc/src/threading.qdoc
+++ b/examples/quick/threading/doc/src/threading.qdoc
@@ -45,7 +45,7 @@
Inside the worker thread, the ListModel is synchronized once the data is
finished loading:
- \snippet threading/threadedlistmodel/dataloader.js 0
+ \snippet threading/threadedlistmodel/dataloader.mjs 0
\section1 WorkerScript
@@ -60,7 +60,7 @@
\snippet threading/workerscript/workerscript.qml 0
The workerscript then is free to take a really long time to calculate it:
- \snippet threading/workerscript/workerscript.js 0
+ \snippet threading/workerscript/workerscript.mjs 0
When it's done, the result returns to the main scene via the WorkerScript
type:
diff --git a/examples/quick/threading/threadedlistmodel/dataloader.js b/examples/quick/threading/threadedlistmodel/dataloader.mjs
index 86a4424dbc..86a4424dbc 100644
--- a/examples/quick/threading/threadedlistmodel/dataloader.js
+++ b/examples/quick/threading/threadedlistmodel/dataloader.mjs
diff --git a/examples/quick/threading/threadedlistmodel/timedisplay.qml b/examples/quick/threading/threadedlistmodel/timedisplay.qml
index cafb1be02e..5ad901c676 100644
--- a/examples/quick/threading/threadedlistmodel/timedisplay.qml
+++ b/examples/quick/threading/threadedlistmodel/timedisplay.qml
@@ -66,7 +66,7 @@ Rectangle {
WorkerScript {
id: worker
- source: "dataloader.js"
+ source: "dataloader.mjs"
}
// ![0]
diff --git a/examples/quick/threading/threading.qrc b/examples/quick/threading/threading.qrc
index 6d15b7ef71..5dc6dff443 100644
--- a/examples/quick/threading/threading.qrc
+++ b/examples/quick/threading/threading.qrc
@@ -2,9 +2,9 @@
<qresource prefix="/threading">
<file>threading.qml</file>
<file>threadedlistmodel/timedisplay.qml</file>
- <file>threadedlistmodel/dataloader.js</file>
+ <file>threadedlistmodel/dataloader.mjs</file>
<file>workerscript/Spinner.qml</file>
- <file>workerscript/workerscript.js</file>
+ <file>workerscript/workerscript.mjs</file>
<file>workerscript/workerscript.qml</file>
</qresource>
</RCC>
diff --git a/examples/quick/threading/workerscript/workerscript.js b/examples/quick/threading/workerscript/workerscript.mjs
index 9953958086..9953958086 100644
--- a/examples/quick/threading/workerscript/workerscript.js
+++ b/examples/quick/threading/workerscript/workerscript.mjs
diff --git a/examples/quick/threading/workerscript/workerscript.qml b/examples/quick/threading/workerscript/workerscript.qml
index 6c279d4a46..735cc8d1f1 100644
--- a/examples/quick/threading/workerscript/workerscript.qml
+++ b/examples/quick/threading/workerscript/workerscript.qml
@@ -56,7 +56,7 @@ Rectangle {
//! [1]
WorkerScript {
id: myWorker
- source: "workerscript.js"
+ source: "workerscript.mjs"
onMessage: {
if (messageObject.row == rowSpinner.value && messageObject.column == columnSpinner.value){ //Not an old result