Using QProcess::startDetached
, I need to pass a dynamic argument list which is coming from another process to the starting process.
const QString & prog, const QStringList & args, const QString & workingDirectory ...)
Note that arguments that contain spaces are not passed to the process as separate arguments.
...
Windows: Arguments that contain spaces are wrapped in quotes. The started process will run as a regular standalone process.
I have a string which contains below text, It comes from an external program without any control on it:
-c "resume" -c "print 'Hi!'" -c "print 'Hello World'"
I need to pass above string to QProcess::startDetached
so that the starting program catches it as same as above string.
Do I have to parse the string and build a string-list? Or anyone has a better solution?