Is there any way to refresh/update a Context Property
I have a QVariantMap instance and im passing it as a Context Property by
//code block 1
//code block 2
if i populate theMap at code block 1 i can see changes in QML side but if i do it in code block 2 the changes will no be occur in QML.
My question is how can i update theMap after passing it as a ContextProperty.
Feel free to suggest different approaches :)
The property is copied when you assign it.
You should use a QObject instead, and define your data as Q_PROPERTY with NOTIFY signals, so that QML engine can know it has changed.
thx for answer. i solved this problem by setting the context property each time i update it.
- i passed the ApplciaitonViewer object as a paramter to the helper class constructor.
it is working now. but im worried about its drawbacks. what can they be? do u have an opinion?