Undo the setContextProperty
QML and Qt Quick
3
Posts
3
Posters
888
Views
1
Watching
-
Within my team we talked about such a feature. If the Qt object is gone, the QML can try to access an invalid reference. It is the same as using a invalid pointer to an not existing object.
From my point of view it is not necessary to handle this situation.
What is your reason? -
@CPP
Export2QML *obj = new Export2QML;
contxt->setContextProperty("abc",obj);
viewer.show();
contxt->setContextProperty("abc",NULL);@@QML
if (abc != null) { abc.display(); }else { console.log("Object is null") }@