PDA

View Full Version : get finished signal from a thread



ProTonS
21st August 2009, 13:27
Hello boys,

I am trying to implement a thread into my gui application.
I intend to use this thread to make calcs and show the results in a table after this.
Well, I need get a finish signal from my thread and get the values to put into my tables.

how do I get this signal.

I´ve tried:


connect(thread, SIGNAL(finished()), SLOT(ThreadStop()));


But my application never enter in the slot threadstop.

Someone knows why?

Thanks in advanced.

yogeshgokul
21st August 2009, 13:30
Please check the return value of your connect statement.

ProTonS
21st August 2009, 13:37
Thanks for the reply, yogeshgokul.

I´ve received: 1, but

Upon successful completion, connect() shall return 0; otherwise, -1 shall be returned and errno set to indicate the error.

Receiving 1 is new to me, well that is possible an error, I´ll try to check why.

yogeshgokul
21st August 2009, 13:41
Receiving 1 is new to me, well that is possible an error, I´ll try to check why.
1 means true. Connect return bool not int.
So your connect is fine.

You need to show your code for more info.
There are several common mistakes people does in case of signal-slots.
Like:
1. Missing Q_OBJECT macro in header.
2. Missing to declare slots under slots section.

ProTonS
21st August 2009, 14:17
I think is ok since the beginning, but I could not realize this. I put a loop inside the slot statement and the application become freeze. Now I just need find out why its freeze.

Well, thanks for your help, yogeshgokul.

cye.