Advertisement
MrPoxipol

QtTimer own thread

Jul 27th, 2014
540
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.24 KB | None | 0 0
  1. // corrected version
  2.     timer = new QTimer();
  3.     timer->setInterval(1000);
  4.     connect(timer, SIGNAL(timeout()), SLOT(tick()));
  5.     timer->start();
  6.  
  7.     thread = new QThread(this);
  8.     timer->moveToThread(thread);
  9.     thread->start();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement