void Window::slotProcess(){
statusWindow->setText("Running process");
/******************* STEP 1: START A NEW PROCESS 1 ***************/
// Connet SIGNAL::STANDARD ERROR with SLOT::UPDATE ERROR, to capture std output
qDebug() << connect(Process_1, SIGNAL(readyReadStandardError()), this, SLOT(UpdateError()));
// Connect SIGNAL::STANDARD OUTPUT with SLOT::UPDATE OUTPUT to capture std error
qDebug() << connect(Process_1, SIGNAL(readyReadStandardOutput()), this, SLOT(UpdateOutput()));
Process_1->start("/home/root/scripts/script_1.sh");
/******************* STEP 2: START A NEW PROCESS 2 ***************/
// Connet SIGNAL::STANDARD ERROR with SLOT::UPDATE ERROR, to capture std output
qDebug() << connect(Process_2, SIGNAL(readyReadStandardError()), this, SLOT(UpdateError()));
// Connect SIGNAL::STANDARD OUTPUT with SLOT::UPDATE OUTPUT to capture std error
qDebug() << connect(Process_2, SIGNAL(readyReadStandardOutput()), this, SLOT(UpdateOutput()));
Process_2->start("/home/root/scripts/script_2.sh");
.....
void Window::slotProcess(){
statusWindow->setText("Running process");
/******************* STEP 1: START A NEW PROCESS 1 ***************/
Process_1 = new QProcess(this);
// Connet SIGNAL::STANDARD ERROR with SLOT::UPDATE ERROR, to capture std output
qDebug() << connect(Process_1, SIGNAL(readyReadStandardError()), this, SLOT(UpdateError()));
// Connect SIGNAL::STANDARD OUTPUT with SLOT::UPDATE OUTPUT to capture std error
qDebug() << connect(Process_1, SIGNAL(readyReadStandardOutput()), this, SLOT(UpdateOutput()));
Process_1->start("/home/root/scripts/script_1.sh");
/******************* STEP 2: START A NEW PROCESS 2 ***************/
Process_2 = new QProcess(this);
// Connet SIGNAL::STANDARD ERROR with SLOT::UPDATE ERROR, to capture std output
qDebug() << connect(Process_2, SIGNAL(readyReadStandardError()), this, SLOT(UpdateError()));
// Connect SIGNAL::STANDARD OUTPUT with SLOT::UPDATE OUTPUT to capture std error
qDebug() << connect(Process_2, SIGNAL(readyReadStandardOutput()), this, SLOT(UpdateOutput()));
Process_2->start("/home/root/scripts/script_2.sh");
.....
To copy to clipboard, switch view to plain text mode
Bookmarks