MyTimer::MyTimer() { // create a timer timer = new QTimer(this); // setup signal and slot connect(timer, SIGNAL(timeout()), this, SLOT(MyTimerSlot())); // msec timer->start(1000); }
MyTimer::MyTimer(QObject *parent) : QObject(parent) { timer = new QTimer(this); connect(timer, SIGNAL (timeout()),this, SLOT(MyTimerSlot())); }