hmmm..right. I used following code but doesn't display anything in my TextEdit.
...
QObject::connect(myProcess,
SIGNAL(readyReadStdError
()),
this,
SLOT(updateError
(myProcess
)));
QObject::connect(myProcess,
SIGNAL(readyReadStdOutput
()),
this,
SLOT(updateText
(myProcess
)));
myProcess->start(program);
...
QObject::connect(myProcess, SIGNAL(readyReadStdError()), this, SLOT(updateError(myProcess)));
QObject::connect(myProcess, SIGNAL(readyReadStdOutput()), this, SLOT(updateText(myProcess)));
myProcess->start(program);
To copy to clipboard, switch view to plain text mode
Definition of updateError and updateText:
void MainWindow
::updateError(QProcess *myProcess
) {
QByteArray data
= myProcess
->readAllStandardError
();
textEdit_verboseOutput
->append
(QString(data
));
}
void MainWindow
::updateText(QProcess *myProcess
) {
QByteArray data
= myProcess
->readAllStandardOutput
();
textEdit_verboseOutput
->append
(QString(data
));
}
void MainWindow::updateError(QProcess *myProcess)
{
QByteArray data = myProcess->readAllStandardError();
textEdit_verboseOutput->append(QString(data));
}
void MainWindow::updateText(QProcess *myProcess)
{
QByteArray data = myProcess->readAllStandardOutput();
textEdit_verboseOutput->append(QString(data));
}
To copy to clipboard, switch view to plain text mode
Bookmarks