Actions in one thread changing data in another

Heads up! You've already completed this tutorial.

johny92010111384 | 2021-05-31 08:25:49 UTC | #1

Hello! I have a problem with my GUI aplication. I'll try to simply explain what i mean, maybe someby can hep me:). I have one main window. Using buttons I can open another windows . when main window is starting it also started another threads e.g. handling data from GPIO. And my problem is: when i press the button in window opened after clicked in main window i can't change anything in other threads. To test it I done everything the same but button was pressed in main window and then everything worked properly. I'm using ThreadPool. Different between main window and additional window is that in main window I'm creating threads wchich started together with main. I also tried to start the specific thread from the additional window and then also everything works but everthing what I'm doing in this thread waiting until I open the additional window. If i didn't open the thread never started but I need the data from this thread all the time when main is runnig. Maybe i wrote this in strange way but hope that somebody understand me. Thanks in advance Pawel


Create GUI Applications with Python & Qt5 by Martin Fitzpatrick — (PyQt5 Edition) The hands-on guide to making apps with Python — Over 10,000 copies sold!

More info Get the book

Well done, you've finished this tutorial! Mark As Complete
[[ user.completed.length ]] completed [[ user.streak+1 ]] day streak

Actions in one thread changing data in another was written by Martin Fitzpatrick .

Martin Fitzpatrick has been developing Python/Qt apps for 8 years. Building desktop applications to make data-analysis tools more user-friendly, Python was the obvious choice. Starting with Tk, later moving to wxWidgets and finally adopting PyQt.