manmohan
5th October 2010, 11:34
Hi,
#include <QtGui/QApplication>
#include <QProcess>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QProcess *myProcess = new QProcess;
myProcess->start("notepad.exe");
//QObject::connect(myProcess,SIGNAL(destroyed()),myP rocess,SLOT());
return a.exec();
}
here when the process->start is used the Notepad application is opening but when I close the notepad the app should also close, in QTCreator it still showing as running in the application output.
how to close the QApplication when the QProcess or the application opened using the qprocess is closed.
here I tried to use the signal and slot but how to close the main app ?
#include <QtGui/QApplication>
#include <QProcess>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QProcess *myProcess = new QProcess;
myProcess->start("notepad.exe");
//QObject::connect(myProcess,SIGNAL(destroyed()),myP rocess,SLOT());
return a.exec();
}
here when the process->start is used the Notepad application is opening but when I close the notepad the app should also close, in QTCreator it still showing as running in the application output.
how to close the QApplication when the QProcess or the application opened using the qprocess is closed.
here I tried to use the signal and slot but how to close the main app ?