问题:
Hi!
I have a small problem concerning two threads and signals/slots connected between them.
My connect looks like this.
-
...
-
...
If the signal is being emitted, I get this error:
-
(Make sure 'QVector<QVector<int> >' is registered usingqRegisterMetaType ( ). )
Also note that I have my sig/slots with a reference, but if I used a connect like this:
I’m getting this:
Object::connect: No such signal dataChanged(QVector<QVector<int> >&)
Sender
Receiver
How can I achieve a connection, do I need to put Q_DECLARE_METATYPE somewhere?
Thanks for your help!
解决方法:
-
// ...
-
qRegisterMetaType <MyArray > ( "MyArray" ) ;
-
// ...
-
connect (
-
this , SIGNAL (blurbDone2 (MyArray ) ) ,
-
this , SLOT (slotBlurb2 (MyArray ) ) ,
-
-
// with this signatures:
-
signals :
-
void blurbDone2 ( const MyArray &bb ) ;
-
-
protected slots :
-
void slotBlurb2 ( const MyArray &bb ) ;