Utils: Introduce QtcProcess::toStandaloneCommandLine()

The goal is to make a QtcProcess incl. environment, working directory,
executable and arguments testable, e.g. in a terminal. The new
toStandaloneCommandLine() returns a string containing the command line
for a call of "env" the data of the QtcProcess instance as parameters.

To be used like:
  qDebug().noquote() << qtcProc.toStandaloneCommandLine();

..and the debug output can be pasted into a terminal.

Change-Id: Ib6cbea290e1eff3279d6e0a67076a624312af879
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Alessandro Portale
2021-09-09 23:03:39 +02:00
parent 8b5192cf75
commit 2fc0ce4843
2 changed files with 21 additions and 0 deletions

View File

@@ -193,6 +193,8 @@ public:
void setStandardInputFile(const QString &inputFile);
QString toStandaloneCommandLine() const;
signals:
void started();
void finished();