In PyQt5 I have one QMainWindow which loads instantly when script is run. Then i want to do some processing which could be done using threading but i also want to load another window after the processing is done. since the processing is not being done in main thread so my window is also not loading in main thread which gives me error. Is there a way through which i can change thread after the execution of function is completed.
Asked
Active
Viewed 37 times
0
Tanmay Daga
- 5
- 2
-
You can write a [connect](https://doc.qt.io/qt-5/signalsandslots.html) to control signals & slots. – Strive Sun Apr 26 '21 at 09:08
-
1in PyQt you can use singnals to send information from (sub)thread to main thread with GUI. In other GUIs you can use global (shared) variable or queue to send value from (sub)thread and main thread would have to periodically check if there is value in this variable/queue. – furas Apr 26 '21 at 10:35
-
Thanks i got my code work after some research on signals and slots from [here](https://stackoverflow.com/questions/65335658/with-pyqt5-implement-two-windows-looping-forever-automatically) – Tanmay Daga Apr 26 '21 at 15:28