qt自定义的串口类判断断开

QObject::connect: Cannot queue arguments of type ‘QSerialPort::SerialPortError’
(Make sure ‘QSerialPort::SerialPortError’ is registered using qRegisterMetaType().)

之前一直有这个错误,添加这个后,再无报错,并且可以判断断开。

qRegisterMetaType<QSerialPort::SerialPortError>("SerialThread");
connect(m_serial, &QSerialPort::errorOccurred,this, &SerialThread::handleSerialError);

猜你喜欢

转载自blog.csdn.net/weixin_43387612/article/details/108170747
今日推荐