diff options
author | Lubomir I. Ivanov <neolit123@gmail.com> | 2017-07-17 18:05:28 +0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-07-28 07:31:11 -0700 |
commit | 52316229cdd57a7c11092bc0522f0b67192aead7 (patch) | |
tree | 36fc65b4199de069a73869cd7bf1acdbdb587853 | |
parent | a50e9866d5f42d76338a4cc9a51f54272dea65bc (diff) | |
download | subsurface-52316229cdd57a7c11092bc0522f0b67192aead7.tar.gz |
mapwidget.cpp: register the MapLocation and MapLocationModel types
Apparently the "safe way" is to register C++ types is before the QML
code has loaded. The idea here is that the QML code should know about
these type definitions and be able to operate with them.
TODO: do the same for the mobile version.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
-rw-r--r-- | desktop-widgets/mapwidget.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/desktop-widgets/mapwidget.cpp b/desktop-widgets/mapwidget.cpp index 9f93faed5..50195319e 100644 --- a/desktop-widgets/mapwidget.cpp +++ b/desktop-widgets/mapwidget.cpp @@ -8,12 +8,15 @@ #include "core/dive.h"
#include "core/divesite.h"
#include "mobile-widgets/qmlmapwidgethelper.h"
+#include "qt-models/maplocationmodel.h"
MapWidget *MapWidget::m_instance = NULL;
MapWidget::MapWidget(QWidget *parent) : QQuickWidget(parent)
{
qmlRegisterType<MapWidgetHelper>("org.subsurfacedivelog.mobile", 1, 0, "MapWidgetHelper");
+ qmlRegisterType<MapLocationModel>("org.subsurfacedivelog.mobile", 1, 0, "MapLocationModel");
+ qmlRegisterType<MapLocation>("org.subsurfacedivelog.mobile", 1, 0, "MapLocation");
setSource(QUrl(QStringLiteral("qrc:/mapwidget-qml")));
setResizeMode(QQuickWidget::SizeRootObjectToView);
|