直接先上源码
从源码中看:QObject: Cannot create children for a parent that is in a different thread.
关于parent->thread()在源码中的描述:
从源码中看:QObject: Cannot create children for a parent that is in a different thread.
这个函数白话解释:当前创建的QObject对象与所传入的parent是否是在同一个依附线程中创建的,如果不是同一个依附线程则输出下面令人神志不清,一脸懵逼的打印
从源码中看:QObject: Cannot create children for a parent that is in a different thread.
结论:创建QObject的对象,如果指定parent,则要在同一个依附线程创建才不会报这个问题;(屁话:如果不指定parent肯定就不会报)

相关文章:

  • 2021-09-20
  • 2021-07-08
  • 2021-07-12
  • 2022-01-15
  • 2021-07-12
  • 2021-08-07
  • 2021-10-31
  • 2021-12-30
猜你喜欢
  • 2021-05-09
  • 2021-07-12
  • 2021-09-12
  • 2021-12-22
  • 2021-07-27
  • 2021-11-15
  • 2021-05-02
相关资源
相似解决方案