From a529189d325306c02f4952131b0c7b202cb318ca Mon Sep 17 00:00:00 2001 From: Joe Date: Sun, 24 Nov 2024 15:07:36 +0100 Subject: [PATCH] movetothread walk filesystem --- .../01_movetothread/02_movetothread_walk_filesystem.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/qt_widgets/11_multithreading/01_movetothread/02_movetothread_walk_filesystem.md b/docs/qt_widgets/11_multithreading/01_movetothread/02_movetothread_walk_filesystem.md index 21dfa81..4f6bfbb 100644 --- a/docs/qt_widgets/11_multithreading/01_movetothread/02_movetothread_walk_filesystem.md +++ b/docs/qt_widgets/11_multithreading/01_movetothread/02_movetothread_walk_filesystem.md @@ -9,4 +9,7 @@ parent: 01 Move QObject to Thread ```python {% include src/qtwidgetsexamples/11_multithreading/01_movetothread/02_movetothread_walk_filesystem.py %} -``` \ No newline at end of file +``` + +In [the `moveToThread()` template]({% link docs/qt_widgets/11_multithreading/01_movetothread/01_movetothread_template.md %} we saw a template for moving a `QObject` to a `QThread` but the worker object object did nothing but print a message in the terminal. Now let's see a more realistic example - the `Worker.process()` method walks the file system using `os.walk()` starting with the file system root. This can take some time and could actually block the Gui if done from the main thread. To walk the file system from the background thread using `QObject.moveToThread()` +