I have this code:
QProcess* proceso = new QProcess(); QString programa = "unknow -v"; proceso->start(programa); proceso->waitForFinished(); QString normal = proceso->readAllStandardOutput(); QString errores = proceso->readAllStandardError(); qDebug() << normal; qDebug() << errores; The output I get is:
"" ""
But I want get and error that says: Command not found.
Thanks in advance.
EDITED:
I found this solution using Qt:
int result = system("unknow -v"); if(result!=0) { qDebug() << "No está instalado nasm"; } else { qDebug() << "Está instalado."; } But I want get an output into a QString.
unknow -v, is that some string input from the user?unknowis a program that should be in the path.