Skip to content

Commit

Permalink
movetothread walk filesystem
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeAnonimist committed Nov 24, 2024
1 parent 094aa55 commit a529189
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@ parent: 01 Move QObject to Thread

```python
{% include src/qtwidgetsexamples/11_multithreading/01_movetothread/02_movetothread_walk_filesystem.py %}
```
```

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()`

0 comments on commit a529189

Please sign in to comment.