Hello,
I am using a QThread to do a parallel task.
To do this :
-I have created an instance of my “ObjectInThread” class that I moved into a QThread.
-I connected the thread started signal to a slot of my ObjectInThread class
-Then I started the QThread
This works fine and the function in my “ObjectInThread” executes correctly.
However I cannot find a way to interrupt it. All I have seen on forums is to write the code in my “ObjectInThread” as a while loop that check if it should go on or not, the condition being change by the main thread. In my case the code of “ObjectInThread” cannot be written like this and is more like a long function that I would like to interrupt at any time.
Do you know if there a way to kill a QThread instantenously like it could be done for a process ? I tried to use terminate and used QThread::setTerminationEnable() but it does not work either.
Thanks for your help,
François
↧