QObject::connect: Cannot queue arguments of type 'QSerialPort::SerialPortError'

(Make sure 'QSerialPort::SerialPortError' is registered using qRegisterMetaType().)

 

源代码如下:

    connect(serial, SIGNAL(errorOccurred(QSerialPort::SerialPortError)),
            this, SLOT(deal_with_error(QSerialPort::SerialPortError)), Qt::QueuedConnection);

 

参考解决方法:

https://blog.csdn.net/weixin_43387612/article/details/108170747

 

在源代码前加入如下一句:

qRegisterMetaType<QSerialPort::SerialPortError>("SerialThread");

问题解决.

 

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

相关文章:

  • 2021-09-03
  • 2022-01-29
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-04
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-20
  • 2021-05-21
  • 2021-06-03
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案