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

(Parent is QTextDocument(0x2159a2f3fe0), parent's thread is QThread(0x21599ac8d10), current thread is QThread(0x2159a3502e0)

出现这个问题的原因在于:自己把主线程UI界面的成员传入到了非主线程中,这导致了跨线程,所以出现了这个错误,这个要注意。

 

python3 解决的方法:

1.可以通过emit() 函数发射信号来解决。

2.通过信号与槽分解决。

相关文章:

  • 2021-10-10
  • 2021-11-23
  • 2022-12-23
  • 2021-06-14
  • 2021-12-06
  • 2022-12-23
猜你喜欢
  • 2021-10-18
  • 2022-12-23
  • 2021-05-20
  • 2022-12-23
  • 2022-12-23
  • 2021-06-09
相关资源
相似解决方案