Python中的线程错误& PyQt的
-
07-07-2019 - |
题
我注意到当 setModel 函数在并行线程中执行时(我试过threading.Timer或threading.thread),我明白了:
QObject: Cannot create children for a parent that is in a different thread.
(Parent is QHeaderView(0x1c93ed0), parent's thread is QThread(0xb179c0), current thread is QThread(0x23dce38)
QObject::startTimer: timers cannot be started from another thread
QObject: Cannot create children for a parent that is in a different thread.
(Parent is QTreeView(0xc65060), parent's thread is QThread(0xb179c0), current thread is QThread(0x23dce38)
QObject::startTimer: timers cannot be started from another thread
有什么方法可以解决这个问题吗?
其他提示
看起来你在那里难以接受Qt限制。如果您需要跨线程进行通信的对象,请尝试使用信号或事件。
或者询问Qt民众。它似乎并不特定于PyQt。
不隶属于 StackOverflow