Qt organizes the Qt objects hierarchically. An object can be an orphan or can be the child of another object. When a Qt object is deleted, all its descendants are deleted as well. When programming in C++, orphan objects must be deleted manually.
Two situations arise when a Qt object is exposed the Lua interpreter.
tobool()
.
In general, orphan objects created from a Lua program are owned by Lua. Objects with a parent and orphan objects created from C++ code are not Lua owned and are not affected by the decisions of the Lua garbage collector.