Qt 延时
#include <QTime>
void MainWindow::sleep(unsigned int msec)
{
QTime t = QTime::currentTime().addMSecs(msec);
while(QTime::currentTime() < t)
{
QCoreApplication::processEvents(QEventLoop::AllEvents, 100);
}
}
sleep(500);