From 2c433296b3f570e92e4279ffbdbaecd48f018ec7 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Mon, 17 Aug 2009 17:15:59 +0200 Subject: Doc: Clarified that arguments should be passed as separate strings. Task-number: 178753 Reviewed-by: Trust Me --- src/corelib/io/qprocess.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp index 133d51e..4715eb7 100644 --- a/src/corelib/io/qprocess.cpp +++ b/src/corelib/io/qprocess.cpp @@ -155,8 +155,16 @@ void QProcessPrivate::Channel::clear() \mainclass \reentrant + \section1 Running a Process + To start a process, pass the name and command line arguments of - the program you want to run as arguments to start(). For example: + the program you want to run as arguments to start(). Arguments + are supplied as individual strings in a QStringList. + + For example, the following code snippet runs the analog clock + example in the Motif style on X11 platforms by passing strings + containing "-style" and "motif" as two items in the list of + arguments: \snippet doc/src/snippets/qprocess/qprocess-simpleexecution.cpp 0 \dots @@ -1565,16 +1573,16 @@ QByteArray QProcess::readAllStandardError() process, a warning may be printed at the console, and the existing process will continue running. - Note that arguments that contain spaces are not passed to the + \note Arguments that contain spaces are not passed to the process as separate arguments. - \bold{Windows:} Arguments that contain spaces are wrapped in quotes. - \note Processes are started asynchronously, which means the started() and error() signals may be delayed. Call waitForStarted() to make sure the process has started (or has failed to start) and those signals have been emitted. + \bold{Windows:} Arguments that contain spaces are wrapped in quotes. + \sa pid(), started(), waitForStarted() */ void QProcess::start(const QString &program, const QStringList &arguments, OpenMode mode) @@ -1834,7 +1842,7 @@ bool QProcess::startDetached(const QString &program, otherwise returns false. If the calling process exits, the detached process will continue to live. - Note that arguments that contain spaces are not passed to the + \note Arguments that contain spaces are not passed to the process as separate arguments. \bold{Unix:} The started process will run in its own session and act -- cgit v0.12