Hello, I am trying to create a thread that will execute an external program.
.
.
void MyThread::run()
{
QProcess *cons;
cons = new QProcess( this );
cons->start("/home/bigbill/Desktop/praktiki/test");
.
.
.
when I compile I get the following error
QObject: Cannot create children for a parent that is in a different thread.
So I changed the parent object in the QProcess argument and I set it as MainWindow which is the name of the main class.
cons = new QProcess(MainWindow);
but I get an error: expected primary-expression before ‘)’ token
What is the mistake here?
Bookmarks