how to remove setContextProperty from QMLContext?
Solved
General and Desktop
-
/// in my C++ code
MyCustomObjct* myCustomObjct = new MyCustomObjct();
engine.rootContext()->setContextProperty("customProperty", myCustomObjct);How can I remove this context property once it is done with usage ?
is there any API to reset it? or we need to call setContextProperty("customProperty, nullptr) ? -
@RAJEESHR said in how to remove setContextProperty from QMLContext?:
is there any API to reset it?
yes
or we need to call setContextProperty("customProperty, nullptr) ?
correct, don't forget the object to avoid a memory leak