From cbb63f0e45340f6dd2cc9f360ed4da15c745186f Mon Sep 17 00:00:00 2001 From: Naoto Yamaguchi Date: Wed, 22 Nov 2023 07:54:57 +0900 Subject: 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 --- Application/main.cpp | 73 ++++++++++++++++++++++++++++------------------------ 1 file changed, 39 insertions(+), 34 deletions(-) (limited to 'Application/main.cpp') 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 -#include -#include -#include -#include -#include - - -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 +#include +#include +#include +#include +#include + +#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(); +} -- cgit