PDA

View Full Version : Send emit from QThread to QMainWindow



Mokhtar.Rahmoun
12th May 2015, 18:14
hello.
i'm using a QThread and i must emit a vtkmageData to the MainWindow to affiche an evolution of the traitement.

i must do the `emit()` in a funtion to send a few images.
i tried to the `emit()` from the function who does the traitement but it does not work.

My question is must i do the `emit` in the `run()` function or can i do it in an other function?
Thank you.

anda_skoa
12th May 2015, 18:59
You can do the emit in any method of the class that declares the signal.

Have you checked that the connect() worked?

Cheers,
_

Mokhtar.Rahmoun
12th May 2015, 22:44
Yes the connect Work well but when i emit the signal from a function it's not working.
Thanks bro for your response

anda_skoa
13th May 2015, 08:35
Do you get any runtime errors?
Have you tried with a signal without arguments.
Can you show the code how you create and connect the thread?

Cheers,
_