showdisplaytext.cpp 527 B

12345678910111213141516171819202122232425262728
  1. #include "showdisplaytext.h"
  2. ShowDisplayText::ShowDisplayText()
  3. {
  4. this->stop = false;
  5. }
  6. ShowDisplayText::~ShowDisplayText()
  7. {
  8. qDebug()<<QDateTime::currentDateTime().toString("yyyy-MM-dd HH:mm:ss")\
  9. <<"ShowDisplayText Destroyed.";
  10. }
  11. void ShowDisplayText::abort()
  12. {
  13. this->stop = true;
  14. }
  15. void ShowDisplayText::run()
  16. {
  17. int i=1;
  18. while(!stop)
  19. {
  20. if(i>6)
  21. i=1;
  22. emit showText(QString(".").leftJustified(i++,'.'));
  23. msleep(500);
  24. }
  25. }