在QThreadpool线程池里启动了一个线程,该线程的run方法里使用了command对象的lrmotor_ctl方法,这个command对象是个单例在主线程创建的,它调用了自己的成员去做QSerialPort去做串口通信。运行这个方法的时候就报错了报错信息如下。不知道怎么一回事。
QObject: Cannot create children for a parent that is in a different thread.
(Parent is QSerialPort(0x42fcc4c), parent's thread is QThread(0x297dd58), current thread is lrmotorrun(0xd361ab0)