This class is used to run a process (command + args) as a separate thread as a separate thread. More...
#include <CThread.h>
Public Member Functions | |
ProcessThread (const QString &, const QString &, QWidget *main) | |
constructor -- used to initialize the main window, the command name and the args for the command | |
virtual QString | output () const |
get the results (output stream) from the process | |
virtual QString | errors () const |
get the errors (error stream) from the process | |
virtual | ~ProcessThread () |
destructor -- free the library that this thread loaded | |
Static Public Member Functions | |
static QWidget * | dialog (QWidget *, ProcessThread *, const QString &text=QString("Process"), QIcon icon=QIcon()) |
creates a dialog that shows the name of the running thread and a button for terminating the thread | |
Protected Slots | |
virtual void | stopProcess () |
unload the library (if loaded) and delete it | |
Protected Member Functions | |
virtual void | run () |
initializes the function pointers through the main window and then runs the target function | |
Protected Attributes | |
QString | exe |
the name of the executable | |
QString | args |
the arguments | |
QString | outputStream |
the output from the process | |
QString | errStream |
the error from the process | |
QProcess | process |
Tinkercell's main window. |
This class is used to run a process (command + args) as a separate thread as a separate thread.
Definition at line 48 of file CThread.h.
Tinkercell::ProcessThread::ProcessThread | ( | const QString & | exe, | |
const QString & | args, | |||
QWidget * | main | |||
) |
constructor -- used to initialize the main window, the command name and the args for the command
QString | command | |
QString | arguments | |
QWidget | main window |
Definition at line 57 of file CThread.cpp.
References stopProcess().
Tinkercell::ProcessThread::~ProcessThread | ( | ) | [virtual] |
destructor -- free the library that this thread loaded
Definition at line 86 of file CThread.cpp.
References stopProcess().
QWidget * Tinkercell::ProcessThread::dialog | ( | QWidget * | mainWindow, | |
ProcessThread * | newThread, | |||
const QString & | text = QString("Process") , |
|||
QIcon | icon = QIcon() | |||
) | [static] |
creates a dialog that shows the name of the running thread and a button for terminating the thread
QWidget | main window | |
ProcessThread | ||
QString | text to display | |
QIcon | icon to display |
Definition at line 28 of file CThread.cpp.
References close().
QString Tinkercell::ProcessThread::errors | ( | ) | const [virtual] |
get the errors (error stream) from the process
Definition at line 96 of file CThread.cpp.
References errStream.
QString Tinkercell::ProcessThread::output | ( | ) | const [virtual] |
get the results (output stream) from the process
Definition at line 91 of file CThread.cpp.
References outputStream.
void Tinkercell::ProcessThread::run | ( | ) | [protected, virtual] |
initializes the function pointers through the main window and then runs the target function
Definition at line 67 of file CThread.cpp.
References args, errStream, exe, outputStream, and process.
void Tinkercell::ProcessThread::stopProcess | ( | ) | [protected, virtual, slot] |
unload the library (if loaded) and delete it
Definition at line 80 of file CThread.cpp.
References process.
Referenced by ProcessThread(), and ~ProcessThread().
QString Tinkercell::ProcessThread::args [protected] |
QString Tinkercell::ProcessThread::errStream [protected] |
QString Tinkercell::ProcessThread::exe [protected] |
QString Tinkercell::ProcessThread::outputStream [protected] |
QProcess Tinkercell::ProcessThread::process [protected] |
Tinkercell's main window.
Definition at line 86 of file CThread.h.
Referenced by run(), and stopProcess().