45 #include <QtCore/qiodevice.h> 46 #include <QtCore/qstringlist.h> 47 #include <QtCore/qshareddata.h> 57 #if (!defined(Q_OS_WIN32) && !defined(Q_OS_WINCE)) || defined(qdoc) 61 typedef struct _PROCESS_INFORMATION *
Q_PID;
78 {
return !(*
this == other); }
136 void start(
const QString &program,
const QStringList &arguments, OpenMode mode = ReadWrite);
137 void start(
const QString &program, OpenMode mode = ReadWrite);
148 void closeWriteChannel();
151 void setStandardOutputFile(
const QString &
fileName, OpenMode mode = Truncate);
152 void setStandardErrorFile(
const QString &
fileName, OpenMode mode = Truncate);
153 void setStandardOutputProcess(
QProcess *destination);
155 #if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN) 156 QString nativeArguments()
const;
157 void setNativeArguments(
const QString &arguments);
160 QString workingDirectory()
const;
161 void setWorkingDirectory(
const QString &dir);
163 void setEnvironment(
const QStringList &environment);
174 bool waitForStarted(
int msecs = 30000);
177 bool waitForFinished(
int msecs = 30000);
182 int exitCode()
const;
194 static int execute(
const QString &program);
199 static bool startDetached(
const QString &program);
209 void finished(
int exitCode);
214 void readyReadStandardOutput();
215 void readyReadStandardError();
220 virtual void setupChildProcess();
239 #endif // QT_NO_PROCESS The QProcessEnvironment class holds the environment variables that can be passed to a program...
#define QT_END_NAMESPACE
This macro expands to.
ProcessError
This enum describes the different types of errors that are reported by QProcess.
virtual bool waitForReadyRead(int msecs)
Blocks until new data is available for reading and the readyRead() signal has been emitted...
virtual void close()
First emits aboutToClose(), then closes the device and sets its OpenMode to NotOpen.
ProcessChannel
This enum describes the process channels used by the running process.
virtual qint64 writeData(const char *data, qint64 len)=0
Writes up to maxSize bytes from data to the device.
The QByteArray class provides an array of bytes.
static void clear(QVariant::Private *d)
ProcessState
This enum describes the different states of QProcess.
#define Q_DISABLE_COPY(Class)
Disables the use of copy constructors and assignment operators for the given Class.
#define Q_PRIVATE_SLOT(d, signature)
QSharedDataPointer< QProcessEnvironmentPrivate > d
The QString class provides a Unicode character string.
The QObject class is the base class of all Qt objects.
virtual bool atEnd() const
Returns true if the current read and write position is at the end of the device (i.e.
virtual qint64 bytesToWrite() const
For buffered devices, this function returns the number of bytes waiting to be written.
#define QT_BEGIN_NAMESPACE
This macro expands to.
static bool isEmpty(const char *str)
ProcessChannelMode
This enum describes the process channel modes of QProcess.
The QStringList class provides a list of strings.
static const char * data(const QByteArray &arr)
virtual bool isSequential() const
Returns true if this device is sequential; otherwise returns false.
virtual qint64 readData(char *data, qint64 maxlen)=0
Reads up to maxSize bytes from the device into data, and returns the number of bytes read or -1 if an...
bool operator!=(const QProcessEnvironment &other) const
Returns true if this and the other QProcessEnvironment objects are different.
ExitStatus
This enum describes the different exit statuses of QProcess.
virtual qint64 bytesAvailable() const
Returns the number of bytes that are available for reading.
virtual bool waitForBytesWritten(int msecs)
For buffered devices, this function waits until a payload of buffered written data has been written t...
#define Q_DECLARE_PRIVATE(Class)
virtual bool canReadLine() const
Returns true if a complete line of data can be read from the device; otherwise returns false...
The QIODevice class is the base interface class of all I/O devices in Qt.
static QString fileName(const QString &fileUrl)
bool operator==(QBool b1, bool b2)
The QProcess class is used to start external programs and to communicate with them.