标签:quit nbsp lin stat event 源代码 1.5 style ati
一:方法1
QTime t; t.start(); while(t.elapsed()<1000)
{ QCoreApplication::processEvents();
}
二:方法2
QElapsedTimer t; t.start(); while(t.elapsed()<1000)
{ QCoreApplication::processEvents();
}
三:方法3
QTest::qWait
源代码:
namespace QTest { inline static void qWait(int ms) { Q_ASSERT(QCoreApplication::instance()); QElapsedTimer timer; timer.start(); do { QCoreApplication::processEvents(QEventLoop::AllEvents, ms); QTest::qSleep(10); } while (timer.elapsed() < ms); } ...
四:方法4
QEventLoop eventloop;
QTimer::singleShot(100, &eventloop, SLOT(quit())); eventloop.exec();
标签:quit nbsp lin stat event 源代码 1.5 style ati
原文地址:http://www.cnblogs.com/zhangnianyong/p/7110541.html