QmlObject
Open, HighPublic

Description

Why should a single app use so many distinct engines? Shouldn't one always try to use just a single shared engine? What problem is being solved here - cleanup of resources when unloading a top level component? Having multiple engines doesn't come for free - esp. would also lead to multiple instances of QML singletons and could also lead to threading issues etc.

The name is also too generic, and might even at some point appear in Qt Quick itself

Related Objects

mwolff created this task.Nov 23 2019, 11:36 AM
alex triaged this task as High priority.Jan 6 2022, 11:47 AM
alex added a subscriber: alex.

Considering that we have breakup plans for KDeclarative, we should work on this.

Why should a single app use so many distinct engines?

As far as I can see, the API allows one to reuse the engines

Why should a single app use so many distinct engines?

That is where the QmlObjectSharedEngine class comes into play and ensures that only one engine exists.

alex added a comment.Aug 18 2022, 8:40 AM

As far as I can see, the API allows one to reuse the engines

For the plasma applets config there is a usecase, though in KF6 that will go away.

On the KF6 weekly we agreed on phasing out the KPackage bits. Those are very rarely used anyways and prevent this class being moved to a high tier.

alex added a comment.Mar 4 2023, 7:58 AM

https://invent.kde.org/frameworks/kcmutils/-/merge_requests/121 takes care of the last kcmutils usage. Plasma-Frameworks has it's own engine now

alex moved this task from Backlog to Done on the KF6 board.Mar 4 2023, 7:59 AM
alex claimed this task.