Allow adding additional QML import paths via environment variable
This is useful to use a custom build of kirigami.
This commit is contained in:
parent
a8364be203
commit
25ef1dbe91
|
@ -95,6 +95,12 @@ int runQuickGui(int argc, char *argv[], const QtConfigArguments &qtConfigArgs, c
|
|||
context->setContextProperty(QStringLiteral("app"), &application);
|
||||
context->setContextProperty(QStringLiteral("description"), QStringLiteral(APP_DESCRIPTION));
|
||||
context->setContextProperty(QStringLiteral("dependencyVersions"), QStringList(DEPENCENCY_VERSIONS));
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
|
||||
const auto importPaths = qEnvironmentVariable(PROJECT_VARNAME_UPPER "_QML_IMPORT_PATHS").split(QChar(':'));
|
||||
for (const auto &path : importPaths) {
|
||||
engine.addImportPath(path);
|
||||
}
|
||||
#endif
|
||||
engine.load(QUrl(QStringLiteral("qrc:/qml/main.qml")));
|
||||
|
||||
// run event loop
|
||||
|
|
Loading…
Reference in New Issue