Weird signal and slot problem
-
hello, I'm trying to conect a signal from an object, to a signal on a thread, both QString. I make the conection on main window, that is my code (in mainwindow):
gMsg = new getmsg(this,mWSize.x,mWSize.y); serPort = new sport(this); serPort->start(); connect(gMsg,SIGNAL(rqstAll(QString)),serPort,SLOT(updateMsg(QString)),Qt::QueuedConnection);the compiler get the next error that i could not solved, deleting the temporary compile directory and right botton on project + clean
I ask you please help on Monday, the boss will give me the talk of dismissal (), but I want the program end.
Thanks in advance
moc_sport.obj:-1: error: LNK2019: unresolved external symbol "public: void __cdecl sport::updateMsg(class QString)" (?updateMsg@sport@@QEAAXVQString@@@Z) referenced in function "private: static void __cdecl sport::qt_static_metacall(class QObject *,enum QMetaObject::Call,int,void * *)" (?qt_static_metacall@sport@@CAXPEAVQObject@@W4Call@QMetaObject@@HPEAPEAX@Z)
-
hello, I'm trying to conect a signal from an object, to a signal on a thread, both QString. I make the conection on main window, that is my code (in mainwindow):
gMsg = new getmsg(this,mWSize.x,mWSize.y); serPort = new sport(this); serPort->start(); connect(gMsg,SIGNAL(rqstAll(QString)),serPort,SLOT(updateMsg(QString)),Qt::QueuedConnection);the compiler get the next error that i could not solved, deleting the temporary compile directory and right botton on project + clean
I ask you please help on Monday, the boss will give me the talk of dismissal (), but I want the program end.
Thanks in advance
moc_sport.obj:-1: error: LNK2019: unresolved external symbol "public: void __cdecl sport::updateMsg(class QString)" (?updateMsg@sport@@QEAAXVQString@@@Z) referenced in function "private: static void __cdecl sport::qt_static_metacall(class QObject *,enum QMetaObject::Call,int,void * *)" (?qt_static_metacall@sport@@CAXPEAVQObject@@W4Call@QMetaObject@@HPEAPEAX@Z)
I'm not 100% which one of these causes the error but:
- Make sure that your
sportclass has theQ_OBJECTmacro - If you added the
Q_OBJECTmacro after the first compile, you must manually re-runqmakeby Build -> Run qmake - Make sure that your
sportclass actually has theupdateMsg()method implemented - Make sure that your
sportclass actually lists theupdateMsg()method in thepublic slotssection
I hope that helps.
- Make sure that your