Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想用子对象(线程QObject)创建(对象),并以该对象为父对象(用于在对象存活时保持线程存活)并制作但在这种情况下启动线程的信号不起作用。QThreadobject.moveToThread(thread)
QObject
QThread
object.moveToThread(thread)
简单地:
这是怎么回事?
[编辑]:由于评论而放弃了我最初的答案
也许这样做如下:
然后,当您删除对象时,它会发出已删除的(),这将停止线程。该线程将发出finished(),这将调用它的deleteLater() 槽。