Python - PyQt Signals - Emit and send argument to different class
<p>This is only my second question here so please do bear with me. I have a python script that currently contains two classes. One of which manages a GUI and the other is my 'worker thread' (a pyqt thread) . In order for me to be able to update the GUI from the 'worker thread' I understand that I can setup pyqt signals and emit these at different points. Back in the GUI thread I have set up connect statements which should connect to a function within the GUI thread which will update the GUI.</p>

<p>In order for this GUI update function to know what it has to do with the GUI, the signal is also emitting an extra argument but this is not being picked up in the GUI thread. I think I know why this is happening but I can't work out how I can get it to work correctly.</p>

<p>I would include some code but there are so many possible parts that could be included I thought I would wait and see what bits anyone specifically asks for.</p>

<p>I hope someone can help me with this.</p>

<p><strong>EDIT:</strong> Thank you for your answer farshed-. I should have put this in the original question, I am using PyQt 4. I know that a thread class should be run using 'start()' but when I do, the program crashes instantly and stops working. This has led me to use 'run()' to commence the thread after initializing it.</p>

<p>Also, in your code segment the updateProgressBar method is called without being handed any arguments directly in the connect statement and only within the brackets where the method is defined, is it shown that the method will receive an argument. I have tried this with mine but it just tells me what you would expect to hear if you were calling any normal function and not providing the necessary number of arguments. Possibly this is because I am using PyQt 4 or it could be because I am directly calling 'run()' instead of 'start()'. Hopefully that can aid you to answer my question further if possible. Once again, please do mention if there are any code segments you would like me to include.</p>

<p>Thanks,</p>

<p>BoshJailey</p>