• 12103阅读
  • 3回复

[提问]qt没有waitforsingleobject吗 [复制链接]

上一主题 下一主题
离线u332744
 
只看楼主 倒序阅读 楼主  发表于: 2011-10-12
我找不到啊 有个waitforfinished,这个不能设定等待时间啊
离线ppdayz

只看该作者 1楼 发表于: 2011-10-13
回 楼主(u332744) 的帖子
bool QProcess::waitForFinished ( int msecs = 30000 )
Blocks until the process has finished and the finished() signal has been emitted, or until msecs milliseconds have passed.
Returns true if the process finished; otherwise returns false (if the operation timed out, if an error occurred, or if this QProcess is already finished).
This function can operate without an event loop. It is useful when writing non-GUI applications and when performing I/O operations in a non-GUI thread.
Warning: Calling this function from the main (GUI) thread might cause your user interface to freeze.
If msecs is -1, this function will not time out.

这个么?
离线u332744
只看该作者 2楼 发表于: 2011-10-15
QFuture<void> f0 = run(delmdb, QString("delmdb"));
    f0.waitForFinished();

QProcess::execute("sockm.exe");

怎么实现等待?
离线aiolia0122

只看该作者 3楼 发表于: 2012-01-04
QWaitCondition试试
快速回复
限100 字节
 
上一个 下一个