summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qprocess.cpp
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@digia.com>2013-09-03 22:06:26 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-05 21:17:44 +0200
commit50a8a5e7959ca315e812413661a76576b7c3bbb8 (patch)
treefadd591bb515323705ee372ea069b58471eedb07 /src/corelib/io/qprocess.cpp
parentfba0a307914772b286e8f315e0d1dec5ce7935f8 (diff)
add QProcess::InputChannelMode
this enables forwarding standard input from the parent process. Change-Id: I7ee72b9842acc96320d4da693b95dd15d9a7b4d4 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Diffstat (limited to 'src/corelib/io/qprocess.cpp')
-rw-r--r--src/corelib/io/qprocess.cpp53
1 files changed, 51 insertions, 2 deletions
diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp
index 27a8bce3fe..7f4d7f0313 100644
--- a/src/corelib/io/qprocess.cpp
+++ b/src/corelib/io/qprocess.cpp
@@ -608,8 +608,8 @@ void QProcessPrivate::Channel::clear()
/*!
\enum QProcess::ProcessChannelMode
- This enum describes the process channel modes of QProcess. Pass
- one of these values to setProcessChannelMode() to set the
+ This enum describes the process output channel modes of QProcess.
+ Pass one of these values to setProcessChannelMode() to set the
current read channel mode.
\value SeparateChannels QProcess manages the output of the
@@ -652,6 +652,26 @@ void QProcessPrivate::Channel::clear()
*/
/*!
+ \enum QProcess::InputChannelMode
+ \since 5.2
+
+ This enum describes the process input channel modes of QProcess.
+ Pass one of these values to setInputChannelMode() to set the
+ current write channel mode.
+
+ \value ManagedInputChannel QProcess manages the input of the running
+ process. This is the default input channel mode of QProcess.
+
+ \value ForwardedInputChannel QProcess forwards the input of the main
+ process onto the running process. The child process reads its standard
+ input from the same source as the main process.
+ Note that the main process must not try to read its standard input
+ while the child process is running.
+
+ \sa setInputChannelMode()
+*/
+
+/*!
\enum QProcess::ProcessError
This enum describes the different types of errors that are
@@ -779,6 +799,7 @@ QProcessPrivate::QProcessPrivate()
{
processChannel = QProcess::StandardOutput;
processChannelMode = QProcess::SeparateChannels;
+ inputChannelMode = QProcess::ManagedInputChannel;
processError = QProcess::UnknownError;
processState = QProcess::NotRunning;
pid = 0;
@@ -1244,6 +1265,34 @@ void QProcess::setProcessChannelMode(ProcessChannelMode mode)
}
/*!
+ \since 5.2
+
+ Returns the channel mode of the QProcess standard input channel.
+
+ \sa setInputChannelMode(), InputChannelMode
+*/
+QProcess::InputChannelMode QProcess::inputChannelMode() const
+{
+ Q_D(const QProcess);
+ return d->inputChannelMode;
+}
+
+/*!
+ \since 5.2
+
+ Sets the channel mode of the QProcess standard intput
+ channel to the \a mode specified.
+ This mode will be used the next time start() is called.
+
+ \sa inputChannelMode(), InputChannelMode
+*/
+void QProcess::setInputChannelMode(InputChannelMode mode)
+{
+ Q_D(QProcess);
+ d->inputChannelMode = mode;
+}
+
+/*!
Returns the current read channel of the QProcess.
\sa setReadChannel()