I want to use commands:
cd /opencv/opencv-3.0.0-alpha/samples/cpp/
./cpp-example-facedetect lena.jpg
to run a sample code of OpenCV on clicked() method of button in Qt application. So I use:
void MainWindow::on_btSample_clicked()
{
QProcess process1;
QProcess process2;
process1.setStandardOutputProcess(&process2);
process1.start("cd /opencv/opencv-3.0.0-alpha/samples/cpp");
process1.waitForBytesWritten();
process2.start("./cpp-example-facedetect lena.jpg");
}
I added necessary library to use it. But I have an error when I run my application.
QProcess: Destroyed while process ("./cpp-example-facedetect") is still running.
How can I fix it? If the way I make isn't right, plz give me another way. Thank u in advance!