Starting QProcess from QThread
I was using QThreads in Qt where my need is to launch a command-line executable from within a Qt thread and run the same within the thread's context. I have used the below mentioned code for the same which seems to be running fine. However, I wanted to know if this kind of usage is permitted since we are launching a QProcess from within a QThread.
Code:
void Help_Menu_Thread::run()
{
Insert_Log("INFO::Help file referred by Admin");
HelpStart.execute("c:\\windows\\hh.exe LPRS_help.chm");
HelpStart.close();
}
Awaiting your response.
Regards,
Sandeep
Re: Starting QProcess from QThread
I would just use QProcess::startDetached and not use a thread at all for this kind of stuff.
Re: Starting QProcess from QThread
Since, Thread is a lightweight and process is the heavyweight, So it is unnecessary to define a heavyweight process under lightweight. I am not confirmed about that, but that what my perception says....