Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. #ifndef GUY_H
  2. #define GUY_H
  3.  
  4. #include <QGraphicsItem>
  5. #include <QTimer>
  6. #include <QObject>
  7.  
  8. class Guy : public QGraphicsItem
  9. {
  10. public:
  11. Guy(int x, int y);
  12.  
  13. void timerStart();
  14.  
  15. public slots:
  16. void onTimeOutTimer();
  17.  
  18. [...]
  19.  
  20. QTimer *timer;
  21. }
  22.  
  23. #endif // GUY_H
  24.  
  25. #include "guy.h"
  26.  
  27. #include <QTimer>
  28. #include <QObject>
  29.  
  30. #include <stdio.h>
  31. #include <iostream>
  32.  
  33. Guy::Guy(int x, int y)
  34. {
  35. timer = new QTimer();
  36. }
  37.  
  38. void Guy::timerStart()
  39. {
  40. QObject::connect(timer, SIGNAL(timeout()), this, SLOT(onTimeOutTimer()));
  41. this->timer->setInterval(1000);
  42. this->timer->start();
  43. std::cout << "starting timer" << std::endl;
  44. }
  45.  
  46. void Guy::onTimeOutTimer()
  47. {
  48. std::cout << "check" << std::endl;
  49. }
  50.  
  51. No matching function for call to 'QObject::connect(QTimer*&, const char*, Guy* const, const char*)'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement