|
| KLFBlockProcess (QObject *parent=0) |
|
| ~KLFBlockProcess () |
|
void | setProcessAppEvents (bool processAppEvents) |
|
QByteArray | getAllStderr () |
|
QByteArray | getAllStdout () |
|
bool | processNormalExit () const |
|
int | processExitStatus () const |
|
virtual QString | getInterpreterPath (const QString &ext) |
| The interpter path to use for the given extension.
|
|
| QProcess (QObject *parent) |
|
void | start (const QString &program, const QStringList &arguments, OpenMode mode) |
|
void | start (const QString &command, OpenMode mode) |
|
void | start (OpenMode mode) |
|
virtual bool | open (OpenMode mode) |
|
QString | program () const |
|
void | setProgram (const QString &program) |
|
QStringList | arguments () const |
|
void | setArguments (const QStringList &arguments) |
|
ProcessChannelMode | readChannelMode () const |
|
void | setReadChannelMode (ProcessChannelMode mode) |
|
ProcessChannelMode | processChannelMode () const |
|
void | setProcessChannelMode (ProcessChannelMode mode) |
|
InputChannelMode | inputChannelMode () const |
|
void | setInputChannelMode (InputChannelMode 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) |
|
void | setStandardErrorFile (const QString &fileName, OpenMode mode) |
|
void | setStandardOutputProcess (QProcess *destination) |
|
QString | nativeArguments () const |
|
void | setNativeArguments (const QString &arguments) |
|
CreateProcessArgumentModifier | createProcessArgumentsModifier () const |
|
void | setCreateProcessArgumentsModifier (CreateProcessArgumentModifier modifier) |
|
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 |
|
qint64 | processId () const |
|
bool | waitForStarted (int msecs) |
|
virtual bool | waitForReadyRead (int msecs) |
|
virtual bool | waitForBytesWritten (int msecs) |
|
bool | waitForFinished (int msecs) |
|
QByteArray | readAllStandardOutput () |
|
QByteArray | readAllStandardError () |
|
int | exitCode () const |
|
QProcess::ExitStatus | exitStatus () const |
|
virtual qint64 | bytesAvailable () const |
|
virtual qint64 | bytesToWrite () const |
|
virtual bool | isSequential () const |
|
virtual bool | canReadLine () const |
|
virtual void | close () |
|
virtual bool | atEnd () const |
|
void | terminate () |
|
void | kill () |
|
void | started () |
|
void | finished (int exitCode) |
|
void | finished (int exitCode, QProcess::ExitStatus exitStatus) |
|
void | error (QProcess::ProcessError error) |
|
void | errorOccurred (QProcess::ProcessError error) |
|
void | stateChanged (QProcess::ProcessState newState) |
|
void | readyReadStandardOutput () |
|
void | readyReadStandardError () |
|
| QIODevice (QObject *parent) |
|
OpenMode | openMode () const |
|
void | setTextModeEnabled (bool enabled) |
|
bool | isTextModeEnabled () const |
|
bool | isOpen () const |
|
bool | isReadable () const |
|
bool | isWritable () const |
|
int | readChannelCount () const |
|
int | writeChannelCount () const |
|
int | currentReadChannel () const |
|
void | setCurrentReadChannel (int channel) |
|
int | currentWriteChannel () const |
|
void | setCurrentWriteChannel (int channel) |
|
virtual qint64 | pos () const |
|
virtual qint64 | size () const |
|
virtual bool | seek (qint64 pos) |
|
virtual bool | reset () |
|
qint64 | read (char *data, qint64 maxSize) |
|
QByteArray | read (qint64 maxSize) |
|
QByteArray | readAll () |
|
qint64 | readLine (char *data, qint64 maxSize) |
|
QByteArray | readLine (qint64 maxSize) |
|
void | startTransaction () |
|
void | commitTransaction () |
|
void | rollbackTransaction () |
|
bool | isTransactionStarted () const |
|
qint64 | write (const char *data, qint64 maxSize) |
|
qint64 | write (const char *data) |
|
qint64 | write (const QByteArray &byteArray) |
|
qint64 | peek (char *data, qint64 maxSize) |
|
QByteArray | peek (qint64 maxSize) |
|
void | ungetChar (char c) |
|
bool | putChar (char c) |
|
bool | getChar (char *c) |
|
QString | errorString () const |
|
void | readyRead () |
|
void | channelReadyRead (int channel) |
|
void | bytesWritten (qint64 bytes) |
|
void | channelBytesWritten (int channel, qint64 bytes) |
|
void | aboutToClose () |
|
void | readChannelFinished () |
|
| QObject (QObject *parent) |
|
virtual bool | event (QEvent *e) |
|
virtual bool | eventFilter (QObject *watched, QEvent *event) |
|
virtual const QMetaObject * | metaObject () const |
|
QString | objectName () const |
|
void | setObjectName (const QString &name) |
|
bool | isWidgetType () const |
|
bool | isWindowType () const |
|
bool | signalsBlocked () const |
|
bool | blockSignals (bool block) |
|
QThread * | thread () const |
|
void | moveToThread (QThread *targetThread) |
|
int | startTimer (int interval, Qt::TimerType timerType) |
|
void | killTimer (int id) |
|
T | findChild (const QString &name, Qt::FindChildOptions options) const |
|
QList< T > | findChildren (const QString &name, Qt::FindChildOptions options) const |
|
QList< T > | findChildren (const QRegExp ®Exp, Qt::FindChildOptions options) const |
|
QList< T > | findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const |
|
const QObjectList & | children () const |
|
void | setParent (QObject *parent) |
|
void | installEventFilter (QObject *filterObj) |
|
void | removeEventFilter (QObject *obj) |
|
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const |
|
bool | disconnect (const char *signal, const QObject *receiver, const char *method) const |
|
bool | disconnect (const QObject *receiver, const char *method) const |
|
void | dumpObjectTree () |
|
void | dumpObjectInfo () |
|
bool | setProperty (const char *name, const QVariant &value) |
|
QVariant | property (const char *name) const |
|
QList< QByteArray > | dynamicPropertyNames () const |
|
void | destroyed (QObject *obj) |
|
void | objectNameChanged (const QString &objectName) |
|
QObject * | parent () const |
|
bool | inherits (const char *className) const |
|
void | deleteLater () |
|
|
static QString | detectInterpreterPath (const QString &interp, const QStringList &addpaths=QStringList()) |
|
int | execute (const QString &program, const QStringList &arguments) |
|
int | execute (const QString &command) |
|
bool | startDetached (const QString &program, const QStringList &arguments, const QString &workingDirectory, qint64 *pid) |
|
bool | startDetached (const QString &command) |
|
QStringList | systemEnvironment () |
|
QString | nullDevice () |
|
QString | tr (const char *sourceText, const char *disambiguation, int n) |
|
QString | trUtf8 (const char *sourceText, const char *disambiguation, int n) |
|
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
|
QMetaObject::Connection | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
|
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type) |
|
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, Functor functor) |
|
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type) |
|
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
|
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
|
bool | disconnect (const QMetaObject::Connection &connection) |
|
bool | disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method) |
|
A QProcess subclass for code-blocking process execution.
A Code-blocking (but not GUI-blocking) process executor
Use for example like:
A QProcess subclass for code-blocking process execution.
This class provides functionality for passing data to STDIN and getting data from STDOUT and STDERR afterwards.
- Author
- Philippe Faist <phili.nosp@m.ppe..nosp@m.faist.nosp@m.@blu.nosp@m.ewin..nosp@m.ch>
Definition at line 56 of file klfblockprocess.h.
The interpter path to use for the given extension.
This function will be queried by startProcess() when we have to execute a script.
Subclasses may reimplement to e.g. query user settings etc. Subclasses may of course also make use of detectInterpreterPath().
The default implementation treats some common script extensions ("py", "rb", "sh") and tries to find the interpreter using detectInterpreterPath().
Definition at line 118 of file klfblockprocess.cpp.
References KLF_DEBUG_BLOCK, and klfDbg.
Referenced by startProcess().
Starts cmd (which is a list of arguments, the first being the program itself) and blocks until process stopped. The QT event loop is updated regularly so that the GUI doesn't freeze.
Read result with QProcess::readStdout() and QProcess::readStderr(), get process exit info with processNormalExit() and processExitStatus().
- Returns
- TRUE upon success, FALSE upon failure.
Definition at line 137 of file klfblockprocess.cpp.
References QMap::begin(), QProcess::closeWriteChannel(), QThread::currentThread(), QProcess::environment(), QMap::erase(), QProcess::error(), getInterpreterPath(), KLF_ASSERT_CONDITION, KLF_DEBUG_BLOCK, klfDbg, QMap::last(), QCoreApplication::processEvents(), QProcess::program(), QProcess::setEnvironment(), QMap::size(), QProcess::start(), QProcess::waitForFinished(), QProcess::waitForStarted(), and QIODevice::write().
Referenced by startProcess().