1. QTimer *timer = new QTimer( myObject );
connect( timer, SIGNAL(timeout()), myObject, SLOT(timerDone()) );
timer->start( 2000, TRUE ); // 2秒單觸發(fā)定時(shí)器
QTimer *t = new QTimer( myObject );
connect( t, SIGNAL(timeout()), SLOT(processOneThing()) );
t->start( 2000, FALSE ); // 2秒單觸發(fā)定時(shí)器
2.void QTimer::singleShot ( int msec, QObject * receiver, const char * member ) [靜態(tài)]
QTimer::singleShot( 10*60*1000, &a, SLOT(quit()) );