python PyQt5 多线程报错 QObject: Cannot create children for a parent that is in a different thread.

出错详情:

QObject: Cannot create children for a parent that is in a different thread.
(Parent is QNetworkAccessManager(0x2db2d8f1880), parent’s thread is QThread(0x2db2cb760a0), current thread is QThread(0x2db2da2a4e0)

原因:主线程UI界面的成员传入到了非主线程中,这导致了跨线程。

python3 解决的方法:

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

2.通过信号与槽分解决

上一篇:Spark 往Kudu中写入时 cannot import authentication data from a different user: old='', new='


下一篇:SAP事务码MM02里的字段属性控制