Utils: Introduce a QtcProcess::startDetached

A convenience wrapper around QProcess::startDetached().

Change-Id: If4228e8405ad4d5e172930593a6f670874211767
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2021-08-12 12:33:28 +02:00
parent 35fcd96b85
commit 026b4ddcda
2 changed files with 10 additions and 0 deletions

View File

@@ -645,6 +645,14 @@ void QtcProcess::interrupt()
#endif #endif
} }
bool QtcProcess::startDetached(const CommandLine &cmd, const FilePath &workingDirectory, qint64 *pid)
{
return QProcess::startDetached(cmd.executable().toUserOutput(),
cmd.splitArguments(),
workingDirectory.toUserOutput(),
pid);
}
void QtcProcess::setLowPriority() void QtcProcess::setLowPriority()
{ {
d->m_process->setLowPriority(); d->m_process->setLowPriority();

View File

@@ -109,6 +109,8 @@ public:
void terminate(); void terminate();
void interrupt(); void interrupt();
static bool startDetached(const CommandLine &cmd, const FilePath &workingDirectory,
qint64 *pid = nullptr);
// Starts the command and waits for finish. User input processing depends // Starts the command and waits for finish. User input processing depends
// on whether setProcessUserEventWhileRunning was called. // on whether setProcessUserEventWhileRunning was called.
void runBlocking(); void runBlocking();