首页| 论坛| 消息
主题:Qt的多线程是不是不能使用QTimer
回帖:沉默小ai:你实在是想用继承QThread的方式的话,把QTimer 的对象在run函数内创建,这样这个QTimer就属于这个线程了,继承的Qthread的类的创建、构造函数的实际上还是由 创建 继承的Qthread的类 的线程操作的。  (2019-11-07 11:23) 
在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)
下一楼›:wcrqpdb:在run内创建也不行,报QObject: Cannot create children for a parent that is in a dif ..
‹上一楼:你实在是想用继承QThread的方式的话,把QTimer 的对象在run函数内创建,这样这个QTimer就属于这 ..

查看全部回帖(34)
«返回主帖