From a1ca0c99deef5fcacb05d004ce69025886a220a4 Mon Sep 17 00:00:00 2001 From: Laszlo Papp Date: Sat, 23 Jul 2022 12:56:04 +0100 Subject: [PATCH] QProcess: Extend the setStandardOutputFile doc It seems to be a hidden gem that one can stop redirecting the standard output to a file without creating a new QProcess instance. I have discovered this while browsing the private implementation of QProcess trying to answer this question: https://stackoverflow.com/a/72989131/2682142 I believe that this should be documented unless it is not meant to be guaranteed behavior. Change-Id: I180764d4cc56f6395d6d65942077e3ede63c71ea Reviewed-by: Thiago Macieira --- src/corelib/io/qprocess.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp index 276190426c..e116fe861d 100644 --- a/src/corelib/io/qprocess.cpp +++ b/src/corelib/io/qprocess.cpp @@ -1378,6 +1378,9 @@ void QProcess::setStandardInputFile(const QString &fileName) Calling setStandardOutputFile() after the process has started has no effect. + If \a fileName is an empty string, it stops redirecting the standard + output. This is useful for restoring the standard output after redirection. + \sa setStandardInputFile(), setStandardErrorFile(), setStandardOutputProcess() */