The missing startDetached overloaded function
-
@kshegunov Okay, I get you, I know the reason now. But, If Qt's goal is make everything easier, why not add one more overloaded startDetached ? If this one:
bool startDetached(const QString & program);Could do the right thing cross Qt versions and OS versions, add another one:
bool startDetached(const QString & program, const QString& workDir);Is more complete. At least I think so.
@Aman-Jiang
there is already QProcess::setWorkingDirectory() available -
@Aman-Jiang
there is already QProcess::setWorkingDirectory() available@raven-worx A QProcess object will wait for the process, a "detach" member function is missing.
-
@kshegunov Okay, I get you, I know the reason now. But, If Qt's goal is make everything easier, why not add one more overloaded startDetached ? If this one:
bool startDetached(const QString & program);Could do the right thing cross Qt versions and OS versions, add another one:
bool startDetached(const QString & program, const QString& workDir);Is more complete. At least I think so.
But, If Qt's goal is make everything easier, why not add one more overloaded startDetached ?
Well, you have to ask Qt devs that, but if I were to hazard a guess - probably simplicity of implementation and compliance with
QProcess::start, but I haven't checked the source so I'm just speculating. While the split rules are the same across OSes some (notably Windows) have somewhat stringent requirements for characters in paths (or rather the command line interpretercmddoes), Linux is much more relaxed on this matter.
My advice is to just wrap a very simple LL(1) parser (it's so simple you can even write it by hand in an hour) and use it to split your command line."detach" member function is missing.
I'm not sure you can detach from a process freely on all platforms, so I'm assuming it's not missing, it's just impossible to provide in a cross-platform consistent manner.
Kind regards.
-
But, If Qt's goal is make everything easier, why not add one more overloaded startDetached ?
Well, you have to ask Qt devs that, but if I were to hazard a guess - probably simplicity of implementation and compliance with
QProcess::start, but I haven't checked the source so I'm just speculating. While the split rules are the same across OSes some (notably Windows) have somewhat stringent requirements for characters in paths (or rather the command line interpretercmddoes), Linux is much more relaxed on this matter.
My advice is to just wrap a very simple LL(1) parser (it's so simple you can even write it by hand in an hour) and use it to split your command line."detach" member function is missing.
I'm not sure you can detach from a process freely on all platforms, so I'm assuming it's not missing, it's just impossible to provide in a cross-platform consistent manner.
Kind regards.
@kshegunov Okay. Thank you for your advice, I will think about that.