summaryrefslogtreecommitdiffstats
path: root/startupscreen/main.cpp
diff options
context:
space:
mode:
authorAapo Rotonen <aapo.rotonen@qt.io>2024-02-05 14:25:07 +0200
committerAapo Rotonen <aapo.rotonen@qt.io>2024-03-22 07:41:55 +0000
commit4ff817db04b6e9ce7691b2c1ed54568441d32519 (patch)
treecf61a0ef1e7cf55b6e9bc05ebbc607ecb2af7ef6 /startupscreen/main.cpp
parent28042f4e7cb7ade04e032499e77d4fa49c679fa8 (diff)
Add QSR version to startupscreenHEADdev
Add own version of QSR screen to startupscreen. It has functionality that will start the qsrdemo in the target device. Task-number: QSR-2290 Change-Id: I9d931553cfe99598c97d6b17c2d6a09d17ad457d Reviewed-by: Samuli Piippo <samuli.piippo@qt.io> Reviewed-by: Jussi Witick <jussi.witick@qt.io>
Diffstat (limited to 'startupscreen/main.cpp')
-rw-r--r--startupscreen/main.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/startupscreen/main.cpp b/startupscreen/main.cpp
index 9d8e371..77d3e02 100644
--- a/startupscreen/main.cpp
+++ b/startupscreen/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2020 The Qt Company Ltd.
+** Copyright (C) 2024 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the examples of Qt for Device Creation.
@@ -63,11 +63,17 @@ int main(int argc, char *argv[])
app.setApplicationVersion(QLatin1String(qVersion()));
SettingsManager settingsManager;
+
qmlRegisterSingletonInstance("StartupScreen", 1, 0, "SettingsManager", &settingsManager);
QtButtonImageProvider imageProvider;
QQmlApplicationEngine engine;
+#ifdef QSR
+ if (app.windowIcon().isNull()) {
+ app.setWindowIcon(QIcon(":/assets/QSR_Logo.png"));
+ }
+#endif
engine.addImageProvider("QtButton", &imageProvider);
engine.addImportPath("qrc:/imports");
const QUrl url(QStringLiteral("qrc:/StartupScreen.qml"));
@@ -76,6 +82,7 @@ int main(int argc, char *argv[])
if (!obj && url == objUrl)
QCoreApplication::exit(-1);
}, Qt::QueuedConnection);
+
engine.load(url);
return app.exec();