Thanks for the "qApp" tip.

and sorry for the bad names I gave to functions. Actually there is no other thread, there is just a function with infinite loop and I added "a->processEvents();" in order to prevent freezing in widgets as you can see in code above.

Simply ReceiveThread() continues to run infinite loop when widget is closed, I need to stop this infinite loop.

Thanks anyway