QTimerEvent


1. QTimerEvent

startTimer(5);

void timerEvent(QTimerEvent *);


void NeHeWidget::timerEvent(QTimerEvent *)
{
  updateGL();
}
 

2. QTime SLOT

  QTimer *t;

  t = new QTimer(this);
  connect(t, SIGNAL(timeout()), this, SLOT(updateGL()));
  t->start(5);
 

你可能感兴趣的:(timer)