QT报错:QObject::connect: Cannot queue arguments of type ‘QImage&‘(Make sure ‘QImage&‘ is registered u

在使用QT中的connect函数传递两个线程之间的数据时报错:QObject::connect: Cannot queue arguments of type 'QImage&'(Make sure 'QImage&' is registered using qRegisterMetaType().)

函数原型:connect(camera, &DahuaCamera::showImageSignal, this, &Bar::showImage);

解决方法:

将void showImage(QImage& img);修改为void showImage(const QImage& img);

void showImageSignal(QImage& img);修改为void showImageSignal(const QImage& img);

你可能感兴趣的:(QT,qt,数据库,开发语言)