Почему ругается? Гуглил, не могу найти ответа. Слот описал, метод описал, связать не получается.. Помогите, пожалуйста.
QObject::connect(timer, SIGNAL(timeout()), this, SLOT(timer_overflow()));
C:\Users\Vesbat\Desktop\Test\map.cpp:18: ошибка: no matching function for call to 'QObject::connect(QTimer*&, const char*, Map*, const char*)' QObject::connect(timer, SIGNAL(timeout()), this, SLOT(timer_overflow()));
Пытаюсь коннект выполнить в своем классе map.cpp:
#include "map.h"
#include <QTimer>
#include <QLabel>
Map::Map(int height, int weight){
}
void Map::timer_overflow(){
timer->stop();
}
void Map::move(QLabel *_hero){
hero=_hero;
timer = new QTimer;
QObject::connect(timer, SIGNAL(timeout()), this, SLOT(timer_overflow()));
timer->start(110);
}
void Map::initialize(int i, int j, QPushButton *btn){
massMap[i][j]=btn;
}
Map::~Map(){
}
Собственно, вот map.h:
#ifndef MAP_H
#define MAP_H
#include <QMainWindow>
#include <QLabel>
#include <QPushButton>
#include <QWidget>
#include <QString>
#include <QTimer>
class Map{
Q_OBJECT
public slots:
void timer_overflow();
public:
struct coordinate{
int _x,_y;
};
QLabel *hero;
QTimer *timer;
QPushButton *massMap[5][5];
Map(int height, int weight);
~Map();
void move(QLabel *hero);
void initialize(int i, int j, QPushButton *btn);
};
#endif // MAP_H