From 99c2bf6290170bfef40a258fcf21e2e498bcc7c8 Mon Sep 17 00:00:00 2001 From: "Lubomir I. Ivanov" Date: Sun, 16 Jul 2017 03:16:13 +0300 Subject: mapwidget.cpp: obtain a reference of the MapWidgetHelper from QML Use findChild() to obtain the only MapWidgetHelper object created in the MapWidget.qml. Store the reference as a member variable - m_mapHelper. Signed-off-by: Lubomir I. Ivanov --- desktop-widgets/mapwidget.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'desktop-widgets/mapwidget.cpp') diff --git a/desktop-widgets/mapwidget.cpp b/desktop-widgets/mapwidget.cpp index f5424bb0b..1646b7f51 100644 --- a/desktop-widgets/mapwidget.cpp +++ b/desktop-widgets/mapwidget.cpp @@ -18,6 +18,7 @@ MapWidget::MapWidget(QWidget *parent) : QQuickWidget(parent) setResizeMode(QQuickWidget::SizeRootObjectToView); m_rootItem = qobject_cast(rootObject()); + m_mapHelper = rootObject()->findChild(); } void MapWidget::centerOnDiveSite(struct dive_site *ds) -- cgit v1.2.3-70-g09d2