From 0be702d7a4485b06782a1949b08137f1da1bff56 Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Tue, 5 Jul 2016 19:31:21 +0200 Subject: [PATCH] Add proper offline editing support --- src/qgismobileapp.cpp | 4 ++++ src/qgismobileapp.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/qgismobileapp.cpp b/src/qgismobileapp.cpp index 389405573a..d6616b0bf3 100644 --- a/src/qgismobileapp.cpp +++ b/src/qgismobileapp.cpp @@ -47,6 +47,7 @@ #include "modelhelper.h" #include "rubberband.h" #include "rubberbandmodel.h" +#include "qgsofflineediting.h" QgisMobileapp::QgisMobileapp( QgsApplication *app, QWindow *parent ) : QQuickView( parent ) @@ -93,6 +94,8 @@ QgisMobileapp::QgisMobileapp( QgsApplication *app, QWindow *parent ) connect( this, SIGNAL( loadProjectEnded() ), mIface, SIGNAL( loadProjectEnded() ) ); connect( this, SIGNAL( afterRendering() ), SLOT( onAfterFirstRendering() ), Qt::QueuedConnection ); + mOfflineEditing = new QgsOfflineEditing(); + mSettings.setValue( "/Map/searchRadiusMM", 5 ); show(); @@ -231,6 +234,7 @@ void QgisMobileapp::loadProjectFile( const QString& path ) QgisMobileapp::~QgisMobileapp() { + delete mOfflineEditing; QgsMapLayerRegistry::instance()->removeAllMapLayers(); // Reintroduce when created on the heap // delete QgsEditorWidgetRegistry::instance(); diff --git a/src/qgismobileapp.h b/src/qgismobileapp.h index 02e7724f1d..ffda5b4cbd 100644 --- a/src/qgismobileapp.h +++ b/src/qgismobileapp.h @@ -39,6 +39,7 @@ #endif class AppInterface; +class QgsOfflineEditing; class QgisMobileapp : public QQuickView { @@ -93,6 +94,7 @@ class QgisMobileapp : public QQuickView void loadProjectQuirks(); + QgsOfflineEditing* mOfflineEditing; QgsMapCanvas* mMapCanvas; QgsLayerTreeMapCanvasBridge* mLayerTreeCanvasBridge; QgsLayerTreeModel* mLayerTree;