[Interest] 5.5/5.6 QMLEngine management

mark diener rpzrpzrpz at gmail.com
Sun Jan 10 03:21:01 CET 2016


Hello List:

I have a couple of core QMLEngine questions:

Basic Code Snippet:

QQmlEngine geng ;

QQmlComponent gcomp(&geng)
gcomp.setData( ByteArrayofQML , QUrl() ) ;
gcomp.create() -> Show the QML in the QML Engine
if (gcomp.isError() == false) -> we have visible QML!

1) How does one cause all properties in the root context for QML
engine be triggered to re-evaluate their bindings again. For example
Text { text: gvariable }, it want text object to re-fetch its own
values instead of pushing values with Qobject->setProperty().  Generic
pull instead of specific push.

Can I cause a disturbance in the QmlContext and that would trigger and
"expensive" refetching of text values for example.

2) How does one clear out everything loaded in the root QmlEngine context?

What is the best way to clear the root context of qmlengine of
everything prior to calling
gcomp->setData() and  gcomp->create( ) to load brand new QML into the QmlEngine?

geng->clearComponentCache() ?  Does this really flush everything out
regardless of anything that is currently visible on-screen?

I do not want to build up a pile of QObjects in the engine, I want
them cleanly flushed out.

Thank you for any responses,

md



More information about the Interest mailing list