I want to open .exe file when qt application is started and terminate .exe when the qt application is closed.
QProcess *proc;
Calculator::Calculator(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::Calculator)
{
ui->setupUi(this);
proc = new QProcess(this);
QString fileName = "/ingredient";
proc->start(fileName);
}
Calculator::~Calculator()
{
delete ui;
proc->waitForFinished();
proc->terminate();
}
When I run Qt application, .exe is running. However, .exe is not terminated when I close the qt application, so what should i do?