How can implement Timer for each object 

for example i have class like this

---------------------------------------> person.h

```
#ifndef PERSON_H
#define PERSON_H

#include <QMainWindow>

namespace Ui {
class person;
}

class person : public QMainWindow
{
    Q_OBJECT

public:
    explicit person(QWidget *parent = 0);
    ~person();
    QString Name;
    QTimer *timer;

private:
    Ui::person *ui;
signals:

public slots:

    void onTimer();
private slots:

};

#endif // PERSON_H

```

person.cpp ---------------------->

```
#include "person.h"
#include "ui_person.h"
#include <QString>
#include <QDebug>
#include <QTimer>

person::person(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::person)
{
    ui->setupUi(this);
    timer=new QTimer(this);
    connect(timer, SIGNAL(timeout()), this,SLOT(this->onTimer()));
    timer->start(1000);

}

person::~person()
{
    delete ui;
}

void person::onTimer()
{
    qDebug() << "timer call for "<< Name  ;

```

------------------> main.cpp

```
#include "person.h"
#include <QApplication>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    person first;
    person second;
    first.Name="jack";
    second.Name="frank";

    return a.exec();
}

```

this code work but the timer should interval in constructor and both of object have same interval!

[OUtPut picture](https://i.stack.imgur.com/uTlaH.jpg)

you can see the out put in attached image

Problem is I want start , setInterval the Timer with object like:

```
person first;
first Name= "jack";
first.timer->start(200);
person second;
second Name "frank";
second.timer->start(500);

```

and after my command timer start work not in constractor

in my code when i try to inpet `first.timer` the ponter sign `->` didnt apear!!! and not working