```
The setParent(parent) internally calls QCoreApplication::sendEvent(parent, QChildEvent) that implies running in the thread which created the parent object. That is not the case always, and an internal assertion fails in the debug mode.
```
Backport of [[https://github.com/bitcoin/bitcoin/pull/18948 | core#18948]].