回帖:wcrqpdb:在run内创建也不行,报QObject: Cannot create children for a parent that is in a different thread.
(Parent is readWriteThread(0x21080b80), parent's thread is QThread(0x20fd2530), current thread is readWriteThread(0x21080b80)
(2019-11-07 11:32)
没代码不好评论,记住这种方式只有在run()中的才是另一个线程。所以你的QTimer变量也只能在这里实例化。很多人是在继承QThread的类定义了QTimer的成员变量,以为这个也是在另一个线程,其实不是。