Can we change a rootcontext ?
-
I am very very new to Qt and wanted to know if there is a way I can dynamically update or set the root Context for say QQmlngine or QQuickView ?
-
You can modify the context on the fly, yes (for example by adding properties to it). If you want to completely swap it with another instance: I doubt that it would work, but is worth a try.
-
When we run a rootContext() on say QQuickView or QmlEngine, it returns a qml context. I was wondering if I can set/change this with a new one (qml context) ?
-
I don't know. Consult the documentation. I suspect this is not a common use case and as such is not easily possible. But Qt is free software, so you can modify it to suit your needs.
-
I havn't tried it out yet but i think it should be possible to switch some parts or even the full context property. Give it a try and tell us how it went please.
-
Thank you guys. Will dig further on this :-)
-
Alright, good luck and keep us and this thread up to date, thank you. :)