[Interest] reloading qml components

Bo Thorsen bo at fioniasoftware.dk
Sun Jun 3 13:39:10 CEST 2012


Hi Jeremy,

Den 31-05-2012 17:19, Jeremy skrev:
> Say you have a qml component in a file mycomponent.qml or a network
> resource, etc
>
> Is it possible to trigger a reload of the component from the
> file/source/network/etc so that you can see the changed result live?
> Preferably by re-initializing the same object so that any references to
> it can be preserved.

You can use the Loader object to do dynamic loading.

As for doing it on "the same object", forget about it. Use encapsulation 
to do stuff like this. Don't ever allow implementation details like this 
to spill over into using objects. You wouldn't do this in C++ (I hope) 
and you shouldn't do it in QML either.

So place the loading object in a wrapper instead of letting other 
objects use it directly.

Bo Thorsen,
Fionia Software.

-- 

Expert Qt and C++ developer for hire
Contact me if you need expert Qt help
http://www.fioniasoftware.dk



More information about the Interest mailing list