Make QmlComponentsPool one instance per engine

Authored by davidedmundson on Nov 13 2019, 2:23 PM.

Description

Make QmlComponentsPool one instance per engine

Summary:
If we create 2 engines in an application the singleton is initialised to
the first engine. If that first engine disappears the internal m_unit is
dangling.

A good example of this is systemsettings in the icon view if we enter
two modules one after another. It's currently only kept alive because
the sidebar created the first reference.

BUG: 414003

Test Plan:
System settings in icon view
opened global theme
went back
open fonts theme
didn't crash

Subscribers: plasma-devel

Tags: Kirigami

Differential Revision: https://phabricator.kde.org/D25284