From 38373b81f37ccbf6ec66f43a70fe9622bbcc9593 Mon Sep 17 00:00:00 2001 From: Oliver Eftevaag Date: Fri, 23 Jun 2023 16:11:31 +0200 Subject: convert threading example to manual tests The threading example used a LauncherList to combine two different but related examples into one. I've now separated both into a shared directory called 'threading' Pick-to: 6.6 Change-Id: Iee8898e61adcf69dc67157a1eff5f6ac019a39ca Reviewed-by: Shawn Rutledge --- src/qmlmodels/qqmllistmodel.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/qmlmodels/qqmllistmodel.cpp') diff --git a/src/qmlmodels/qqmllistmodel.cpp b/src/qmlmodels/qqmllistmodel.cpp index 3bd180d072..e75fe22ebc 100644 --- a/src/qmlmodels/qqmllistmodel.cpp +++ b/src/qmlmodels/qqmllistmodel.cpp @@ -1981,7 +1981,7 @@ void DynamicRoleModelNodeMetaObject::propertyWritten(int index) \section1 Using Threaded List Models with WorkerScript - ListModel can be used together with WorkerScript access a list model + ListModel can be used together with WorkerScript to access a list model from multiple threads. This is useful if list modifications are synchronous and take some time: the list operations can be moved to a different thread to avoid blocking of the main GUI thread. @@ -1989,11 +1989,11 @@ void DynamicRoleModelNodeMetaObject::propertyWritten(int index) Here is an example that uses WorkerScript to periodically append the current time to a list model: - \snippet ../../examples/quick/threading/threadedlistmodel/timedisplay.qml 0 + \snippet qml/listmodel/WorkerScript.qml 0 The included file, \tt dataloader.mjs, looks like this: - \snippet ../../examples/quick/threading/threadedlistmodel/dataloader.mjs 0 + \snippet qml/listmodel/dataloader.mjs 0 The timer in the main example sends messages to the worker script by calling \l WorkerScript::sendMessage(). When this message is received, @@ -2004,7 +2004,7 @@ void DynamicRoleModelNodeMetaObject::propertyWritten(int index) You must call sync() or else the changes made to the list from that thread will not be reflected in the list model in the main thread. - \sa {qml-data-models}{Data Models}, {Qt Quick Examples - Threading}, {Qt QML} + \sa {qml-data-models}{Data Models}, {Qt QML} */ QQmlListModel::QQmlListModel(QObject *parent) -- cgit v1.2.3