MyThread наследует QThread, w.getScene() возвращает указатель на объект класса Scene, унаследованный от QGraphicsScene
Создаю в main'e 2 коннекта:
#include <QtGui/QApplication>
#include "mainwindow.h"
#include <time.h>
#include "MyThread.h"
#include "Ship.h"
#include "Port.h"
int main(int argc, char *argv[])
{
//Generating random number
const time_t timer = time(NULL);
tm *timerstruct = localtime(&timer);
uint sec = timerstruct->tm_sec;
qsrand(sec);
int random = qrand()%3;
QApplication a(argc, argv);
MainWindow w;
w.setFixedSize(550,600);
w.show();
Port* port = new Port;
MyThread thread(random,port);
QObject::connect(&thread,SIGNAL(shipMoves(Ship*,qreal)),w.getScene(),SLOT(moveShip(Ship*,qreal)));
QObject::connect(&thread,SIGNAL(newShip(Ship*)),w.getScene(),SLOT(addNewShip(Ship*)));
thread.start();
return a.exec();
}
Получаю для каждого из коннектов
error: no matching function for call to 'QObject::connect(MyThread*, const char*, Scene*, const char*)'
note: candidates are: static bool QObject::connect(const QObject*, const char*, const QObject*, const char*, Qt::ConnectionType)
note: bool QObject::connect(const QObject*, const char*, const char*, Qt::ConnectionType) const
в чём дело?