From a16c3c93890b089964642fc2307436da1444f3dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20B=C5=99=C3=ADza?= Date: Fri, 8 Sep 2023 17:56:44 +0200 Subject: [PATCH] Set plugin and import paths before loading main.qml This fixes missing imports at startup without messing around with the environment. --- src/main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 5d3ad47..f862bda 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -19,8 +19,9 @@ int main(int argc, char *argv[]) app.setOrganizationName("patrickelectric"); commandLineParser.setApplication(&app); - QQmlApplicationEngine appEngine(QUrl("qrc:/main.qml")); + QQmlApplicationEngine appEngine; commandLineParser.setEngine(&appEngine); + appEngine.load(QUrl("qrc:/main.qml")); appEngine.addUrlInterceptor(UrlInterceptor::self()); ProvidesSomething::self()->setEngine(&appEngine);