QTimer::singleShot(2000,this,SLOT(single())); 單次
- timer = new QTimer();
- this->connect(timer,SIGNAL(timeout()),this,SLOT(timerDone()));
- timer->start( 1000 ); //一秒鐘後開始觸發,然後一秒一次
- timer->singleShot(2000,this,SLOT(slotTime())); //2秒鐘觸發一次
QTimer::singleShot(2000,this,SLOT(single())); 單次