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