#include "clock.h"
#include <QTimer>
#include <QDateTime>

MyClockWidget::MyClockWidget(QWidget*parent)
  :QLabel(parent)
{
  QTimer*tm=new QTimer(this);
  tm->setSingleShot(false);
  tm->start(100);
  connect(tm,SIGNAL(timeout()),this,SLOT(updateTime()));
}

void MyClockWidget::updateTime()
{
  setText(QDateTime::currentDateTime().toString());
}
