mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-01 03:13:24 +00:00
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>
This commit is contained in:
parent
a50e9866d5
commit
52316229cd
1 changed files with 3 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue