jimbo
23rd May 2015, 10:10
Hello,
Qt4 / Linux
I'm using QProcess to start a script (myScript.sh) that expects a response.
At the moment I divert the output from the script to a QTextBox.
I never get the yes/no question.
There is more output from the script after the question.
Is it possible to get the question to display? Answer it and get the rest of the output.
I don't want to modify the script.
Regards
QObject::connect(process, SIGNAL(readyReadStandardOutput()), this, SLOT(processOutput()));
QObject::connect(process, SIGNAL(readyReadStandardError()), this, SLOT(processOutput()));
process->start(myCommmands);
void myProg::processOutput()
{
myOutput = new ee_output("Script output", this);
myOutput->t1->setText("Standard output:\n");
myOutput->t1->append(process->readAllStandardOutput());
myOutput->t1->append("Standard Error:\n");
myOutput->t1->append(process->readAllStandardError());
}
This is the textbox display:
Standard output:
This script comes with ABSOLUTELY no warranty. Continue only if you know what you are doing.
Standard Error:
This is the terminal output:
...$ sudo ./myScript.sh -w -f=/home/pi/myFiles/test9999.eep -t=24c256
This script comes with ABSOLUTELY no warranty. Continue only if you know what you are doing.
Do you wish to continue? (yes/no): _
Qt4 / Linux
I'm using QProcess to start a script (myScript.sh) that expects a response.
At the moment I divert the output from the script to a QTextBox.
I never get the yes/no question.
There is more output from the script after the question.
Is it possible to get the question to display? Answer it and get the rest of the output.
I don't want to modify the script.
Regards
QObject::connect(process, SIGNAL(readyReadStandardOutput()), this, SLOT(processOutput()));
QObject::connect(process, SIGNAL(readyReadStandardError()), this, SLOT(processOutput()));
process->start(myCommmands);
void myProg::processOutput()
{
myOutput = new ee_output("Script output", this);
myOutput->t1->setText("Standard output:\n");
myOutput->t1->append(process->readAllStandardOutput());
myOutput->t1->append("Standard Error:\n");
myOutput->t1->append(process->readAllStandardError());
}
This is the textbox display:
Standard output:
This script comes with ABSOLUTELY no warranty. Continue only if you know what you are doing.
Standard Error:
This is the terminal output:
...$ sudo ./myScript.sh -w -f=/home/pi/myFiles/test9999.eep -t=24c256
This script comes with ABSOLUTELY no warranty. Continue only if you know what you are doing.
Do you wish to continue? (yes/no): _