|
QQmlFinalizerHook is meant to replace registerFinalizeCallback. The
latter is more powerful: It allows you to register multiple functions,
depending on various conditions. Moreover, if the component is already
finalized, it directly runs the function.
However, that power is not used anywhere: All we currently use and need
is the ability to run a function after the component is finalized. By
using an inerface instead of some generic registration framework, we can
make finalizers visible to tooling. This is especially important for
qmltc, which needs to instantiate the compiled components and still must
ensure that finalizers do run.
We also use this chance to document the existence of finalizers, as well
as the difference between componentComplete and finalizers. The
interface is kept internal, as asynchronus component instantiation is
still an underdocumented corner of the QML engine, and the implications
of making the interface public are unclear.
Task-number: QTBUG-96054
Change-Id: I876bf9650faac20598cfd6aaea7c6da9bf65d73f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|