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
#include <QtCore/QCoreApplication>
#include<QProcess>
#include<stdio.h>
class TIMEOUT{
public:
signals:
void timeout();
};
void TIMEOUT::timeout(){
//Help me code there. Thanks
}
int main(int argc, char *argv[])
{
TIMEOUT timeout;
QObject::connect(&proc,
SIGNAL(timeout.
timeout()),
&a,
SLOT(quit
()));
proc.execute("C:\\Tesst.exe");
printf("Hello");
proc.waitForFinished(1000);
return a.exec();
}
#include <QtCore/QCoreApplication>
#include<QProcess>
#include<stdio.h>
class TIMEOUT{
public:
signals:
void timeout();
};
void TIMEOUT::timeout(){
//Help me code there. Thanks
}
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
QProcess proc;
TIMEOUT timeout;
QObject::connect(&proc, SIGNAL(timeout.timeout()),&a, SLOT(quit()));
proc.execute("C:\\Tesst.exe");
printf("Hello");
proc.waitForFinished(1000);
return a.exec();
}
To copy to clipboard, switch view to plain text mode
thanks
Bookmarks