The simplest code:
void test
{
QProcess p;
p.start("sleep 10");
p.waitForBytesWritten();
p.waitForFinished(1);
}
Of course, the process cannot be completed before the end of the function, therefore a warning message is displayed:
QProcess: Destroyed while process ("sleep") is still running.
I want this message not to be displayed - I have to kill this process myself before the end of the function, but I cannot find how to do it correctly: p. ~ QProcess (), p.terminate (), p.kill () cannot help me.
NOTE. I do not want to wait for the process to complete, just kill it when it starts.
source
share