aboutsummaryrefslogtreecommitdiffstats
path: root/Application/main.cpp
diff options
context:
space:
mode:
authorNaoto Yamaguchi <naoto.yamaguchi@aisin.co.jp>2023-11-22 07:54:57 +0900
committerNaoto Yamaguchi <naoto.yamaguchi@aisin.co.jp>2023-11-26 20:12:00 +0900
commitcbb63f0e45340f6dd2cc9f360ed4da15c745186f (patch)
tree471935b3ce3238f7bb402942ba8c530cf7892500 /Application/main.cpp
parent5b7127cac34bf44a9d9e58c02b44939955d50890 (diff)
Support for cluster api binding
Existing AGL Instrument Cluster is not implement cluster service only a framework library. This task aim to support cluster service. In 1st step, cluster-refgui will be controlled by cluster-service demo signal. This patch a part of this task. Bug-AGL: SPEC-4991 Change-Id: I1dfdf3a6b9691f536bb96cd197feac89f4137540 Signed-off-by: Naoto Yamaguchi <naoto.yamaguchi@aisin.co.jp>
Diffstat (limited to 'Application/main.cpp')
-rw-r--r--Application/main.cpp73
1 files changed, 39 insertions, 34 deletions
diff --git a/Application/main.cpp b/Application/main.cpp
index 3631708..51b0c39 100644
--- a/Application/main.cpp
+++ b/Application/main.cpp
@@ -14,37 +14,42 @@
* limitations under the License.
*/
-#include <QGuiApplication>
-#include <QQmlApplicationEngine>
-#include <QSurfaceFormat>
-#include <QDir>
-#include <QQmlContext>
-#include <QDebug>
-
-
-int main(int argc, char *argv[])
-{
- QSurfaceFormat defaultFormat;
- defaultFormat.setSwapBehavior(QSurfaceFormat::TripleBuffer);
- defaultFormat.setRenderableType(QSurfaceFormat::OpenGLES);
- defaultFormat.setProfile(QSurfaceFormat::NoProfile);
- defaultFormat.setVersion(2,0);
- defaultFormat.setSwapInterval(1);
- defaultFormat.setDepthBufferSize(8);
- defaultFormat.setAlphaBufferSize(8);
- QSurfaceFormat::setDefaultFormat(defaultFormat);
-
- QGuiApplication app(argc, argv);
-
- QQmlApplicationEngine engine;
- engine.rootContext()->setContextProperty("CurDirPath", QString(QCoreApplication::applicationDirPath()));
- const QUrl url(QStringLiteral("qrc:/main.qml"));
- QObject::connect(&engine, &QQmlApplicationEngine::objectCreated,
- &app, [url](QObject *obj, const QUrl &objUrl) {
- if (!obj && url == objUrl)
- QCoreApplication::exit(-1);
- }, Qt::QueuedConnection);
- engine.load(url);
-
- return app.exec();
-}
+#include <QGuiApplication>
+#include <QQmlApplicationEngine>
+#include <QSurfaceFormat>
+#include <QDir>
+#include <QQmlContext>
+#include <QDebug>
+
+#include "cluster-service.hxx"
+
+int main(int argc, char *argv[])
+{
+ QSurfaceFormat defaultFormat;
+ defaultFormat.setSwapBehavior(QSurfaceFormat::TripleBuffer);
+ defaultFormat.setRenderableType(QSurfaceFormat::OpenGLES);
+ defaultFormat.setProfile(QSurfaceFormat::NoProfile);
+ defaultFormat.setVersion(2,0);
+ defaultFormat.setSwapInterval(1);
+ defaultFormat.setDepthBufferSize(8);
+ defaultFormat.setAlphaBufferSize(8);
+ QSurfaceFormat::setDefaultFormat(defaultFormat);
+
+ QGuiApplication app(argc, argv);
+
+ QQmlApplicationEngine engine;
+ engine.rootContext()->setContextProperty("CurDirPath", QString(QCoreApplication::applicationDirPath()));
+ const QUrl url(QStringLiteral("qrc:/main.qml"));
+ QObject::connect(&engine, &QQmlApplicationEngine::objectCreated,
+ &app, [url](QObject *obj, const QUrl &objUrl) {
+ if (!obj && url == objUrl)
+ QCoreApplication::exit(-1);
+ }, Qt::QueuedConnection);
+ engine.load(url);
+
+ QClusterService cluster_service;
+ cluster_service.start();
+ engine.rootContext()->setContextProperty("cluster_service", &cluster_service);
+
+ return app.exec();
+}