Hook point for consumer-controlled QQmlEngine ownership policy. More...
#include <phosphor-layer/include/PhosphorLayer/IQmlEngineProvider.h>
Public Member Functions | |
| IQmlEngineProvider ()=default | |
| virtual | ~IQmlEngineProvider ()=default |
| virtual QQmlEngine * | engineForSurface (const SurfaceConfig &cfg)=0 |
| Return the engine for a surface being constructed. | |
| virtual void | releaseEngine (QQmlEngine *engine)=0 |
| Called when a Surface that previously received an engine is destroyed. | |
Hook point for consumer-controlled QQmlEngine ownership policy.
Default (when SurfaceFactory::Deps::engineProvider is nullptr): every Surface constructs its own QQmlEngine at warmUp() and destroys it in its own dtor. Full isolation — no cross-surface QML state leakage.
Opt-in sharing: implement this interface, return the same QQmlEngine pointer from every engineForSurface() call, and release it (or not) as you see fit. Singletons and type registrations become visible to all surfaces sharing the engine; that is the trade-off you make when you opt in.
|
default |
|
virtualdefault |
|
pure virtual |
Return the engine for a surface being constructed.
The provider may return:
The returned engine must outlive the Surface that receives it.
|
pure virtual |
Called when a Surface that previously received an engine is destroyed.
Per-surface-engine providers typically delete engine. Shared-engine providers no-op. Pool providers may decrement a refcount.