i got following code

Qt Code:
  1. class freez_session : public QThread
  2. {
  3. Q_OBJECT
  4. public:
  5. explicit freez_session(QObject *parent = 0);
  6. void run();
  7.  
  8. private slots:
  9. void uploadfullmap();
  10. }
  11.  
  12. void freez_session::run()
  13. {
  14. QTimer *tr = new QTimer();
  15. connect(tr, SIGNAL(timeout()), this, SLOT(uploadfullmap()));
  16. tr->start(500);
  17. ...
  18. }
  19.  
  20. void freez_session::uploadfullmap()
  21. {
  22. qDebug() << "uploading full map";
  23. }
To copy to clipboard, switch view to plain text mode 

but uploadfullmap() will never trigger!!

Qt Code:
  1. when i use QTimer *tr = new QTimer(this);
To copy to clipboard, switch view to plain text mode 

i get QObject: Cannot create children for parent that is in different thread...

where in a thread should be timer put so it work properly?