Details
-
Task
-
Resolution: Won't Do
-
P2: Important
-
None
Description
QtQuick.Controls selects a style to be imported at runtime by evaluating a file qtquickcontrols2.conf and some environment variables. Additionally it allows the style to be selected via C++.
We want something similar for QtQml.WorkerScript. Usage of WorkerScripts is not very common and forcing everyone to load the workerscript plugin is a waste. There should be a way of declaring an import as optional in a qmldir file:
optional import QtQml.WorkerScript auto
This would import WorkerScript if the user has not specified otherwise. However, a per-application configuration file or an environment variable might customize the behavior. This would supersede the current qtquickcontrols2.conf, and make the behavior configured in there accessible to QML tooling.
[QtQml] Import=QtQml.Models,MyOwnStaticImport OtherThings=Foo,Bar [QtQuick.Controls] Import=QtQuick.Controls.Material [QtQuick.Controls.Material] Theme=Light Accent=Teal Primary=BlueGrey
The file would be read by the QML engine and the Import configurations would be applied when loading a module. Other entries would be made available through public API.