Details
-
Suggestion
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
None
-
None
Description
The `child->setParent(parent)` behavior is an implicit ownership transfer. Adding `void QObject::addChild(std::unique_ptr<QObject> child) { if (child)
{ child->setParent(this); child.release(); }}` would make this transfer explicit and much easier to be exception-safe.