mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
desktop-widget: move qmlRegister from mapwidget to shared helper
Remove qmlRegister in desktop-widgets/mapwidget in order to have a shared registration in subsurface-helper.cpp Signed-off-by: Jan Iversen <jani@apache.org>
This commit is contained in:
parent
8cc0b6dbc1
commit
ab05fe3cf8
3 changed files with 3 additions and 6 deletions
|
@ -23,10 +23,6 @@ MapWidget *MapWidget::m_instance = NULL;
|
||||||
|
|
||||||
MapWidget::MapWidget(QWidget *parent) : QQuickWidget(parent)
|
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");
|
|
||||||
|
|
||||||
m_rootItem = Q_NULLPTR;
|
m_rootItem = Q_NULLPTR;
|
||||||
m_mapHelper = Q_NULLPTR;
|
m_mapHelper = Q_NULLPTR;
|
||||||
setResizeMode(QQuickWidget::SizeRootObjectToView);
|
setResizeMode(QQuickWidget::SizeRootObjectToView);
|
||||||
|
|
|
@ -25,6 +25,7 @@ void init_ui()
|
||||||
|
|
||||||
void run_ui()
|
void run_ui()
|
||||||
{
|
{
|
||||||
|
register_qml_types();
|
||||||
MainWindow::instance()->show();
|
MainWindow::instance()->show();
|
||||||
qApp->exec();
|
qApp->exec();
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,9 +13,9 @@
|
||||||
#include "profile-widget/qmlprofile.h"
|
#include "profile-widget/qmlprofile.h"
|
||||||
#include "core/downloadfromdcthread.h"
|
#include "core/downloadfromdcthread.h"
|
||||||
#include "qt-models/diveimportedmodel.h"
|
#include "qt-models/diveimportedmodel.h"
|
||||||
|
#endif
|
||||||
#include "map-widget/qmlmapwidgethelper.h"
|
#include "map-widget/qmlmapwidgethelper.h"
|
||||||
#include "qt-models/maplocationmodel.h"
|
#include "qt-models/maplocationmodel.h"
|
||||||
#endif
|
|
||||||
|
|
||||||
void register_qml_types()
|
void register_qml_types()
|
||||||
{
|
{
|
||||||
|
@ -43,6 +43,7 @@ void register_qml_types()
|
||||||
rc = qmlRegisterType<DiveImportedModel>("org.subsurfacedivelog.mobile", 1, 0, "DCImportModel");
|
rc = qmlRegisterType<DiveImportedModel>("org.subsurfacedivelog.mobile", 1, 0, "DCImportModel");
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
qDebug() << "ERROR: Cannot register DCImportModel, QML will not work!!";
|
qDebug() << "ERROR: Cannot register DCImportModel, QML will not work!!";
|
||||||
|
#endif
|
||||||
|
|
||||||
rc = qmlRegisterType<MapWidgetHelper>("org.subsurfacedivelog.mobile", 1, 0, "MapWidgetHelper");
|
rc = qmlRegisterType<MapWidgetHelper>("org.subsurfacedivelog.mobile", 1, 0, "MapWidgetHelper");
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
|
@ -53,5 +54,4 @@ void register_qml_types()
|
||||||
rc = qmlRegisterType<MapLocation>("org.subsurfacedivelog.mobile", 1, 0, "MapLocation");
|
rc = qmlRegisterType<MapLocation>("org.subsurfacedivelog.mobile", 1, 0, "MapLocation");
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
qDebug() << "ERROR: Cannot register MapLocation, QML will not work!!";
|
qDebug() << "ERROR: Cannot register MapLocation, QML will not work!!";
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue