Setup QQmlEngine only once in QmlObject

Authored by broulik on Mar 5 2018, 3:39 PM.

Description

Setup QQmlEngine only once in QmlObject

setupBindings is called for every QmlObject created and installs various bits on the QQmlEngine, such as a network access manager,
a theme icon provider, etc. However, since we use a shared QQmlEngine in various places, most of this needs to be done only once.

This splits setupBindings into a setupContext method for setting up the localized context needed for every instance and a setupEngine
static function that setups an engine. A fourth protected constructor is added that allows to influence the setup behavior.
While at it, delegating constructors are used still calling both setup methods to not change behavior.

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

Details

Committed
broulikMar 5 2018, 3:46 PM
Differential Revision
D9141: Setup QQmlEngine only once in QmlObject
Parents
R296:f54695e1887c: Minor: Fix -Wmismatched-tags warning
Branches
Unknown
Tags
Unknown