1、使用时间耗损循环;

#include <QTime>
...
QTime delayTime = QTime::currentTime().addMSecs(1000);
while( QTime::currentTime() < delayTime)
   QCoreApplication::processEvents(QEventLoop::AllEvents, 100);
...

2、QTimer定时;

#include <QTimer>

...
QEventLoop loop;

QTimer::singleShot(500, &loop, SLOT(quit()));
...

  

相关文章:

  • 2021-12-17
  • 2022-02-07
  • 2022-12-23
  • 2022-12-23
  • 2021-09-22
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-18
  • 2022-12-23
  • 2022-12-23
  • 2021-07-02
  • 2021-11-11
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案