aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPrakash Buddhiraja <buddhip@amazon.com>2018-12-12 16:16:31 -0800
committerPrakash Buddhiraja <buddhip@amazon.com>2018-12-14 18:15:07 -0800
commit26d3b8a6775ced4c8187ddb805acf4b8b94606a6 (patch)
tree476f5f987e9fe03e5fed3c85b76987822d7b9e88
parent2fe96de41a540477d425403cf3a59ec6f5871521 (diff)
Exposed QMLApplicationEngine from AGLApplication
So that apps can use the engine and context for passing the data from C++ to QML Change-Id: Ib17df321fce9f7c3092add0875d04e1f339450c1 Signed-off-by: Prakash Buddhiraja <buddhip@amazon.com>
-rw-r--r--src/aglextras/hmi/aglapplication.cpp5
-rw-r--r--src/aglextras/hmi/aglapplication.h5
2 files changed, 10 insertions, 0 deletions
diff --git a/src/aglextras/hmi/aglapplication.cpp b/src/aglextras/hmi/aglapplication.cpp
index 320aa17..986448a 100644
--- a/src/aglextras/hmi/aglapplication.cpp
+++ b/src/aglextras/hmi/aglapplication.cpp
@@ -95,6 +95,11 @@ AGLApplication::load (const QString &filePath)
d_ptr->engine->load(filePath);
}
+QQmlApplicationEngine*
+AGLApplication::getQmlApplicationEngine() const {
+ return d_ptr->engine;
+}
+
int
AGLApplication::exec (void)
{
diff --git a/src/aglextras/hmi/aglapplication.h b/src/aglextras/hmi/aglapplication.h
index f9d17a0..9c08972 100644
--- a/src/aglextras/hmi/aglapplication.h
+++ b/src/aglextras/hmi/aglapplication.h
@@ -19,10 +19,13 @@
#define AGLAPPLICATION_H
#include <QtAGLExtras/aglextrasglobal.h>
+
#include <QSharedPointer>
#include <QtGui/QGuiApplication>
+class QQmlApplicationEngine;
+
QT_BEGIN_NAMESPACE
class AGLApplicationPrivate;
class AGLEXTRAS_EXPORT AGLApplication : public QGuiApplication
@@ -37,6 +40,8 @@ public:
void load (const QUrl &url);
void load (const QString &filePath);
+ QQmlApplicationEngine* getQmlApplicationEngine() const;
+
int exec (void);
private: