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);
QObject::connect(process, SIGNAL(readyReadStandardOutput()), this, SLOT(processOutput()));
QObject::connect(process, SIGNAL(readyReadStandardError()), this, SLOT(processOutput()));
process->start(myCommmands);
To copy to clipboard, switch view to plain text mode
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());
}
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());
}
To copy to clipboard, switch view to plain text mode
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 textbox display:
Standard output:
This script comes with ABSOLUTELY no warranty. Continue only if you know what you are doing.
Standard Error:
To copy to clipboard, switch view to plain text mode
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): _
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): _
To copy to clipboard, switch view to plain text mode
Bookmarks