How to run a system command in Qt?

QProcess process;
process.start("gedit", QStringList() << docPath);

the same as above

QProcess process;
process.start("gedit", QStringList() << "/home/oDx/Documents/a.txt");

Also, read this.


QProcess::execute() may be helpful:

QProcess::execute("gedit /home/oDx/Documents/a.txt"));