- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Directories
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Types | Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions

# QProcess Class Reference

Search for all occurrences

## Detailed Description

Definition at line 98 of file qprocess.h.

`#include <qprocess.h>`

Inheritance diagram for QProcess:
[legend]

List of all members.

## Public Types
enum | ProcessError { FailedToStart, Crashed, Timedout, ReadError, WriteError, UnknownError }
enum | ProcessState { NotRunning, Starting, Running }
enum | ProcessChannel { StandardOutput, StandardError }
enum | ProcessChannelMode { SeparateChannels, MergedChannels, ForwardedChannels }
enum | ExitStatus { NormalExit, CrashExit }
## Public Slots
void | terminate ()
void | kill ()
## Signals
void | started ()
void | finished (int exitCode)
void | finished (int exitCode, QProcess::ExitStatus exitStatus)
void | error (QProcess::ProcessError error)
void | stateChanged (QProcess::ProcessState state)
void | readyReadStandardOutput ()
void | readyReadStandardError ()
## Public Member Functions
| QProcess (QObject *parent=0)
virtual | ~QProcess ()
void | start (const QString &program, const QStringList &arguments, OpenMode mode=ReadWrite)
void | start (const QString &program, OpenMode mode=ReadWrite)
ProcessChannelMode | readChannelMode () const
void | setReadChannelMode (ProcessChannelMode mode)
ProcessChannelMode | processChannelMode () const
void | setProcessChannelMode (ProcessChannelMode mode)
ProcessChannel | readChannel () const
void | setReadChannel (ProcessChannel channel)
void | closeReadChannel (ProcessChannel channel)
void | closeWriteChannel ()
void | setStandardInputFile (const QString &fileName)
void | setStandardOutputFile (const QString &fileName, OpenMode mode=Truncate)
void | setStandardErrorFile (const QString &fileName, OpenMode mode=Truncate)
void | setStandardOutputProcess (QProcess *destination)
QString | workingDirectory () const
void | setWorkingDirectory (const QString &dir)
void | setEnvironment (const QStringList &environment)
QStringList | environment () const
void | setProcessEnvironment (const QProcessEnvironment &environment)
QProcessEnvironment | processEnvironment () const
QProcess::ProcessError | error () const
QProcess::ProcessState | state () const
Q_PID | pid () const
bool | waitForStarted (int msecs=30000)
bool | waitForReadyRead (int msecs=30000)
bool | waitForBytesWritten (int msecs=30000)
bool | waitForFinished (int msecs=30000)
QByteArray | readAllStandardOutput ()
QByteArray | readAllStandardError ()
int | exitCode () const
QProcess::ExitStatus | exitStatus () const
qint64 | bytesAvailable () const
qint64 | bytesToWrite () const
bool | isSequential () const
bool | canReadLine () const
void | close ()
bool | atEnd () const
## Static Public Member Functions
static int | execute (const QString &program, const QStringList &arguments)
static int | execute (const QString &program)
static bool | startDetached (const QString &program, const QStringList &arguments, const QString &workingDirectory, qint64 *pid=0)
static bool | startDetached (const QString &program, const QStringList &arguments)
static bool | startDetached (const QString &program)
static QStringList | systemEnvironment ()
## Protected Member Functions
void | setProcessState (ProcessState state)
virtual void | setupChildProcess ()
qint64 | readData (char *data, qint64 maxlen)
qint64 | writeData (const char *data, qint64 len)

## Member Enumeration Documentation

enum ProcessError

Search for all occurrences

Enumerator:

  FailedToStart | Search for all occurrences
  Crashed | Search for all occurrences
  Timedout | Search for all occurrences
  ReadError | Search for all occurrences
  WriteError | Search for all occurrences
  UnknownError | Search for all occurrences

Definition at line 102 of file qprocess.h.

                          {
            FailedToStart, //### file not found, resource error
            Crashed,
            Timedout,
            ReadError,
            WriteError,
            UnknownError
        };

enum ProcessState

Search for all occurrences

Enumerator:

  NotRunning | Search for all occurrences
  Starting | Search for all occurrences
  Running | Search for all occurrences

Definition at line 110 of file qprocess.h.

                          {
            NotRunning,
            Starting,
            Running
        };

enum ProcessChannel

Search for all occurrences

Enumerator:

  StandardOutput | Search for all occurrences
  StandardError | Search for all occurrences

Definition at line 115 of file qprocess.h.

                            {
            StandardOutput,
            StandardError
        };

enum ProcessChannelMode

Search for all occurrences

Enumerator:

  SeparateChannels | Search for all occurrences
  MergedChannels | Search for all occurrences
  ForwardedChannels | Search for all occurrences

Definition at line 119 of file qprocess.h.

                                {
            SeparateChannels,
            MergedChannels,
            ForwardedChannels
        };

enum ExitStatus

Search for all occurrences

Enumerator:

  NormalExit | Search for all occurrences
  CrashExit | Search for all occurrences

Definition at line 124 of file qprocess.h.

                        {
            NormalExit,
            CrashExit
        };

## Constructor & Destructor Documentation

QProcess | ( | QObject * | parent = `0` | ) | `[explicit]`

virtual ~QProcess | ( |  | ) | `[virtual]`

## Member Function Documentation

void start | ( | const QString & | program,
|  | const QStringList & | arguments,
|  | OpenMode | mode = `ReadWrite`
| ) |  |

Search for all occurrences

void start | ( | const QString & | program,
|  | OpenMode | mode = `ReadWrite`
| ) |  |

Search for all occurrences

ProcessChannelMode readChannelMode | ( |  | ) | const

Search for all occurrences

void setReadChannelMode | ( | ProcessChannelMode | mode | ) |

Search for all occurrences

ProcessChannelMode processChannelMode | ( |  | ) | const

Search for all occurrences

void setProcessChannelMode | ( | ProcessChannelMode | mode | ) |

Search for all occurrences

ProcessChannel readChannel | ( |  | ) | const

Search for all occurrences

void setReadChannel | ( | ProcessChannel | channel | ) |

Search for all occurrences

void closeReadChannel | ( | ProcessChannel | channel | ) |

Search for all occurrences

void closeWriteChannel | ( |  | ) |

Search for all occurrences

void setStandardInputFile | ( | const QString & | fileName | ) |

Search for all occurrences

void setStandardOutputFile | ( | const QString & | fileName,
|  | OpenMode | mode = `Truncate`
| ) |  |

Search for all occurrences

void setStandardErrorFile | ( | const QString & | fileName,
|  | OpenMode | mode = `Truncate`
| ) |  |

Search for all occurrences

void setStandardOutputProcess | ( | QProcess * | destination | ) |

Search for all occurrences

QString workingDirectory | ( |  | ) | const

Search for all occurrences

void setWorkingDirectory | ( | const QString & | dir | ) |

Search for all occurrences

void setEnvironment | ( | const QStringList & | environment | ) |

Search for all occurrences

QStringList environment | ( |  | ) | const

Search for all occurrences

void setProcessEnvironment | ( | const QProcessEnvironment & | environment | ) |

Search for all occurrences

QProcessEnvironment processEnvironment | ( |  | ) | const

Search for all occurrences

QProcess::ProcessError error | ( |  | ) | const

Search for all occurrences

QProcess::ProcessState state | ( |  | ) | const

Search for all occurrences

Q_PID pid | ( |  | ) | const

Search for all occurrences

bool waitForStarted | ( | int | msecs = `30000` | ) |

Search for all occurrences

bool waitForReadyRead | ( | int | msecs = `30000` | ) | `[virtual]`

Search for all occurrences

Reimplemented from QIODevice.

bool waitForBytesWritten | ( | int | msecs = `30000` | ) | `[virtual]`

Search for all occurrences

Reimplemented from QIODevice.

bool waitForFinished | ( | int | msecs = `30000` | ) |

Search for all occurrences

QByteArray readAllStandardOutput | ( |  | ) |

Search for all occurrences

QByteArray readAllStandardError | ( |  | ) |

Search for all occurrences

int exitCode | ( |  | ) | const

Search for all occurrences

QProcess::ExitStatus exitStatus | ( |  | ) | const

Search for all occurrences

qint64 bytesAvailable | ( |  | ) | const `[virtual]`

Search for all occurrences

Reimplemented from QIODevice.

qint64 bytesToWrite | ( |  | ) | const `[virtual]`

Search for all occurrences

Reimplemented from QIODevice.

bool isSequential | ( |  | ) | const `[virtual]`

Search for all occurrences

Reimplemented from QIODevice.

bool canReadLine | ( |  | ) | const `[virtual]`

Search for all occurrences

Reimplemented from QIODevice.

void close | ( |  | ) | `[virtual]`

Search for all occurrences

Reimplemented from QIODevice.

bool atEnd | ( |  | ) | const `[virtual]`

Search for all occurrences

Reimplemented from QIODevice.

static int execute | ( | const QString & | program,
|  | const QStringList & | arguments
| ) |  | `[static]`

Search for all occurrences

static int execute | ( | const QString & | program | ) | `[static]`

Search for all occurrences

static bool startDetached | ( | const QString & | program,
|  | const QStringList & | arguments,
|  | const QString & | workingDirectory,
|  | qint64 * | pid = `0`
| ) |  | `[static]`

Search for all occurrences

static bool startDetached | ( | const QString & | program,
|  | const QStringList & | arguments
| ) |  | `[static]`

Search for all occurrences

static bool startDetached | ( | const QString & | program | ) | `[static]`

Search for all occurrences

static QStringList systemEnvironment | ( |  | ) | `[static]`

Search for all occurrences

void terminate | ( |  | ) | `[slot]`

Search for all occurrences

void kill | ( |  | ) | `[slot]`

Search for all occurrences

void started | ( |  | ) | `[signal]`

Search for all occurrences

void finished | ( | int | exitCode | ) | `[signal]`

Search for all occurrences

void finished | ( | int | exitCode,
|  | QProcess::ExitStatus | exitStatus
| ) |  | `[signal]`

Search for all occurrences

void error | ( | QProcess::ProcessError | error | ) | `[signal]`

Search for all occurrences

void stateChanged | ( | QProcess::ProcessState | state | ) | `[signal]`

Search for all occurrences

void readyReadStandardOutput | ( |  | ) | `[signal]`

Search for all occurrences

void readyReadStandardError | ( |  | ) | `[signal]`

Search for all occurrences

void setProcessState | ( | ProcessState | state | ) | `[protected]`

Search for all occurrences

virtual void setupChildProcess | ( |  | ) | `[protected, virtual]`

Search for all occurrences

qint64 readData | ( | char * | data,
|  | qint64 | maxlen
| ) |  | `[protected, virtual]`

Search for all occurrences

Implements QIODevice.

qint64 writeData | ( | const char * | data,
|  | qint64 | len
| ) |  | `[protected, virtual]`

Search for all occurrences

Implements QIODevice.

The documentation for this class was generated from the following file:

- QtCore/qprocess.h

QProcess QProcess QProcess QProcess QProcess QProcess QProcess QProcess QProcess QProcess
QProcess QProcess QProcess QProcess QProcess QProcess QProcess QProcess QProcess QProcess