I want the program to check if the script already started and if not - then start it (in Terminal and as root)
Thank you! ;-)
QProcess *proc = new QProcess();
QProcess runs the external script asyncronously, so by doing
proc->start(...); delete proc;
You kill it as soon as it starts (or maybe even before). Try adding waitForFinished() before the delete.
proc->start(...); proc->waitForFinished(); delete proc;