QTest::qSleep(250); //unresponsive
QTest::qWait(250); //stay responsive
QThread::usleep(100); //milliseconds
QThread::msleep(100); //usecs microseconds 微妙
参考:https://blog.csdn.net/xiezhongyuan07/article/details/81169583
https://www.cnblogs.com/yangjunhe460/p/10289613.html
在主线程中休眠的正确方法:
定时器与QEventLoop配合使用
QEventLoop eventloop;
QTimer::singleShot(5000, &eventloop, SLOT(quit()));
eventloop.exec();