I need to execute a system command in Qt and provide an argument for the command.
For example, opening a text file with gedit:
gedit
gedit /home/oDx/Documents/a.txt
But the path /home/oDx/Documents/a.txt will be in a variable like docPath.
/home/oDx/Documents/a.txt
docPath
How can I achieve this?
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.