I'm using QTimer in QThread( or QObject ) class :
Qt Code:
  1. class InfoThread: public QThreed
  2. {
  3. Q_OBJECT
  4. ...
  5. void run();
  6. signals:
  7. void newInfoAvalible( /* some data */ );
  8. private slots:
  9. void update();
  10. ..
  11. private:
  12. QTimer *p_timer;
  13. };
  14.  
  15. InfoThread::Infothread( QObject *parent ) : QThread( parent )
  16. {
  17. p_timer = new QTimer( this );
  18. connect( p_timer, SIGNAL( timeout() ), this, SLOT( update() ) );
  19. }
  20.  
  21. void InfoThread::run()
  22. {
  23. p_timer->start( 1000 );
  24. exec(); // event loop for QTimer
  25. }
  26.  
  27. void InfoThread::update()
  28. {
  29. ...
  30. emit newInfoAvalible( /* some data */ );
  31. }
To copy to clipboard, switch view to plain text mode 

For me code is good, but signal newInfoAvalible( /* some data */ ) causes apps to crash. Wher's the problem?