hi all.
I have a program(called Mother_Program) and this program calls other program( called Tesst.exe), and for 3 seconds the Tesst.exe must close, if Tesst.exe takes bigger than 3 seconds, Mother_Programm have raise time out. But i don't how to code the timeout function?
thanks
This is my code
Qt Code:
  1. #include <QtCore/QCoreApplication>
  2. #include<QProcess>
  3. #include<stdio.h>
  4. class TIMEOUT{
  5. public:
  6. signals:
  7. void timeout();
  8. };
  9. void TIMEOUT::timeout(){
  10. //Help me code there. Thanks
  11. }
  12.  
  13. int main(int argc, char *argv[])
  14. {
  15. QCoreApplication a(argc, argv);
  16. QProcess proc;
  17. TIMEOUT timeout;
  18. QObject::connect(&proc, SIGNAL(timeout.timeout()),&a, SLOT(quit()));
  19. proc.execute("C:\\Tesst.exe");
  20. printf("Hello");
  21. proc.waitForFinished(1000);
  22. return a.exec();
  23. }
To copy to clipboard, switch view to plain text mode 
thanks