Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef GUY_H
- #define GUY_H
- #include <QGraphicsItem>
- #include <QTimer>
- #include <QObject>
- class Guy : public QGraphicsItem
- {
- public:
- Guy(int x, int y);
- void timerStart();
- public slots:
- void onTimeOutTimer();
- [...]
- QTimer *timer;
- }
- #endif // GUY_H
- #include "guy.h"
- #include <QTimer>
- #include <QObject>
- #include <stdio.h>
- #include <iostream>
- Guy::Guy(int x, int y)
- {
- timer = new QTimer();
- }
- void Guy::timerStart()
- {
- QObject::connect(timer, SIGNAL(timeout()), this, SLOT(onTimeOutTimer()));
- this->timer->setInterval(1000);
- this->timer->start();
- std::cout << "starting timer" << std::endl;
- }
- void Guy::onTimeOutTimer()
- {
- std::cout << "check" << std::endl;
- }
- 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