在本版的 【原创】常见的几个Qt编程问题的处理 一帖第14个问题 ::如何启动一个外部程序 中介绍了如何利用QProcess::execute()无阻塞的启动外部程序的方法..
我在qtopia4.4.3中采用了这样的方法调用外部程序后,主进程还是处于阻塞状态,外部程序有响应,贴出这部分代码,大家帮我看看是我哪里写错了。。。或者是有其他的解决方法没有?
还请不吝指教
class MyThread : public QThread
{
public:
void run();
};
void MyThread::run()
{
QString FilePath;
FilePath=find_FILE( );
QString ExePath="/opt/bin/TEST ";
ExePath.append(FilePath);
QProcess::execute(ExePath);
}
TESTMain::TESTMain(QWidget *parent, Qt::WFlags f)
: QWidget(parent, f)
{
MyThread *mythred = new MyThread;
mythred->start();
connect(mythred,SIGNAL(finished()),this,SLOT(close()));
}