ArcGIS Developers

Returned QObjects Parenting

Types returned by the ArcGISRuntime SDK for Qt typically have the QObject used to instantiate them as their parent. Where the parent is long-lived (such as the Map) it may make sense to clean up temporary result types earlier - for example using some form of RAII.

Alternatively, you may require that the results can be accessed after their parent has been removed. In this scenario you must call setParent and provide a new QObject with the appropriate scope - or nullptr if you wish to manage the object yourself.

Feedback on this topic?