Unsolved QObject::connect: Cannot queue arguments of type 'xxx&'(Make sure 'xxx&' is registered using qRegisterMetaType().)
-
Hi,
what is the question?
Can you show your code? -
@mcosta QObject::connnect(), the signal and slot i use signal(const xxx&)
xxx is the param typeand i saw the warning above in the VS output...
-
what
xxx
is??if you are using a custom type you have to register it to be used in MetaType system
-
@mcosta xxx is my own Class
-
@opengpu2 how to register it? i did not register...and it seems to work fine...
-
To register a custom type you have to use
qRegisterMetaType()
. You need to use it if you use QueuedConnection.Read here for more details
-
@mcosta yeh, the sender and reciever are in 2 threads, so its AutoConnection is QueuedConnection
is my own custom Class must have defalut constructor?
what should i do if my Class only have constructor with param? -
I too faced with same situation..
code:@{
connect(serial,SIGNAL(func(cv::String,cv::Mat,QTextStream&)),this,SLOT(func(cv::String,cv::Mat,QTextStream&)));
}@
Error:
Cannot queue arguments of type 'QTextstream&'I got same error for cv::string & cv::Mat but i resolved it using:
qRegisterMetaType< cv::Mat >("cv::Mat");
qRegisterMetaType< cv::String >("cv::String");
but am unable to fix it for QTextstream&
Would you please help me here? -
@nand said:
Cannot queue arguments of type 'QTextstream&'
Have you tried with QTextstream*'
just to see if it like that `?Edit:
It solved the issue. -
Actually there is no need for & in the connect() call. Just remove it.