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);

你可能感兴趣的:(QT,qt)