赞
踩
有时候异步执行不满足我们的需求,于是:
- //author:autumoon
- //联系QQ:4589968
- //日期:2020-11-18
- //同步执行
- QEventLoop eventLoop;
- QMetaObject::Connection connRet = QObject::connect(tuc, SIGNAL(finished(bool, const QString&)), &eventLoop, SLOT(quit()));
- Q_ASSERT(connRet);
- tuc->StartUpload(strMasterFullPath.c_str(), strClientFullPath.c_str());
-
- eventLoop.exec(QEventLoop::ExcludeUserInputEvents);
这种就类似于单线程的感觉,同步执行命令。
放在这里是为了备份,因为有时候把这些命令记下来有点繁琐。
欢迎交流。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。