aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/main.cpp4
-rw-r--r--app/navigation_client.cpp14
2 files changed, 17 insertions, 1 deletions
diff --git a/app/main.cpp b/app/main.cpp
index eb7f3f3..108ce08 100644
--- a/app/main.cpp
+++ b/app/main.cpp
@@ -88,10 +88,12 @@ int main(int argc, char *argv[])
context->setContextProperty("fileOperation", &file);
Navigation *navigation = new Navigation(bindingAddress, context);
- new navigation_client(navigation);
engine.load(QUrl(QStringLiteral("qrc:qml/Main.qml")));
+
QObject *root = engine.rootObjects().first();
+ new navigation_client(navigation, root->findChild<QObject*>("mapwindow"));
+
QQuickWindow *window = qobject_cast<QQuickWindow *>(root);
QObject::connect(window, SIGNAL(frameSwapped()), qwmHandler, SLOT(slotActivateWindow()));
diff --git a/app/navigation_client.cpp b/app/navigation_client.cpp
index f07f6c7..426bbeb 100644
--- a/app/navigation_client.cpp
+++ b/app/navigation_client.cpp
@@ -5,6 +5,20 @@ navigation_client::navigation_client(Navigation *navigation, QObject *parent) :
{
QObject::connect(m_navigation, &Navigation::statusEvent, this, &navigation_client::statusEvent);
QObject::connect(m_navigation, &Navigation::positionEvent, this, &navigation_client::positionEvent);
+
+ // connect the signal to qml inside function(addRoutePointsQml -> do_addRoutePoint)
+ QObject::connect(this, SIGNAL(addRoutePointsQml(QVariant, QVariant, QVariant, QVariant)),
+ parent, SLOT(do_addRoutePoint(QVariant, QVariant, QVariant, QVariant)));
+
+ // connect the signal to qml inside function(positionQml -> do_setCoordinate)
+ QObject::connect(this, SIGNAL(positionQml(QVariant, QVariant,QVariant, QVariant)),
+ parent, SLOT(do_setCoordinate(QVariant, QVariant,QVariant, QVariant)));
+
+ // connect the signal to qml inside function(stopdemoQml -> do_stopnavidemo)
+ QObject::connect(this, SIGNAL(stopdemoQml()), parent, SLOT(do_stopnavidemo()));
+
+ // connect the signal to qml inside function(arrivedestQml -> do_arrivedest)
+ QObject::connect(this, SIGNAL(arrivedestQml()), parent, SLOT(do_arrivedest()));
}
navigation_client::~navigation_client(){}