QT串口发送错误

调式信息

Invalid parameter passed to C runtime function.

Invalid parameter passed to C runtime function.

QObject: Cannot create children for a parent that is in a different thread.

(Parent is QSerialPort(0x17c28fd0), parent's thread is QThread(0x638270), current thread is QThread(0x17bf9bb0)QObject::startTimer: Timers can only be used with threads started with QThread


 原因是我用std::thread创的线程里面又调用了write,timer等线程,write是异步的,用定时器解决周期发送问题

你可能感兴趣的:(Qt)