diff options
author | Louie S <louie@example.com> | 2024-07-24 15:32:29 -0400 |
---|---|---|
committer | Louie S <louie@example.com> | 2024-07-25 17:11:29 -0400 |
commit | 1e02a8b37e2dc74e2d868e818e03e4dda39f4079 (patch) | |
tree | d4941679437ed1c786d919f5a3d891dd57397962 /src/frontend/qtquick/main.cpp | |
parent | 68ce496b5dd082881dde7536677f295bc40ee055 (diff) |
Import values from config.h into qml engine
Diffstat (limited to 'src/frontend/qtquick/main.cpp')
-rw-r--r-- | src/frontend/qtquick/main.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/frontend/qtquick/main.cpp b/src/frontend/qtquick/main.cpp index c2c84fc..e1d43f7 100644 --- a/src/frontend/qtquick/main.cpp +++ b/src/frontend/qtquick/main.cpp @@ -1,5 +1,8 @@ #include <QGuiApplication> #include <QQmlApplicationEngine> +#include <QQmlContext> + +#include "../../../config.h" int main(int argc, char *argv[]) { @@ -9,6 +12,10 @@ int main(int argc, char *argv[]) QGuiApplication app(argc, argv); QQmlApplicationEngine engine; + + // forward values to qml engine + engine.rootContext()->setContextProperty("PROJECT_TITLE", PROJECT_TITLE); + const QUrl url(QStringLiteral("qrc:/main.qml")); QObject::connect( &engine, |