diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index aab84959c..f1898c0b5 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -190,6 +190,7 @@ set(MM_HDRS workspacesmodel.h workspacesproxymodel.h mmstyle.h + externalTypes/mmgeometry.h ) if (NOT WIN32) @@ -331,6 +332,7 @@ target_include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/layer ${CMAKE_CURRENT_SOURCE_DIR}/maptools ${CMAKE_CURRENT_SOURCE_DIR}/position + ${CMAKE_CURRENT_SOURCE_DIR}/externalTypes ) qt_policy(SET QTP0002 NEW) diff --git a/app/externalTypes/mmgeometry.h b/app/externalTypes/mmgeometry.h new file mode 100644 index 000000000..899ac4fc9 --- /dev/null +++ b/app/externalTypes/mmgeometry.h @@ -0,0 +1,40 @@ +/*************************************************************************** +* * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef MMGEOMETRY_H +#define MMGEOMETRY_H + +#include + +#include + +/** + * MMGeometry is just a wrapper around QgsGeometry, which adds equals operator that is missing. + * We expose this type to QML instead of QgsGeometry. The reason is that QML in Qt 6.9+ also checks equality, when firing + * onChanged signal. The missing operator is breaking property bindings. + */ +class MMGeometry: public QgsGeometry +{ + Q_GADGET + QML_VALUE_TYPE( mmGeometry ); + + public: + using QgsGeometry::QgsGeometry; + + MMGeometry() = default; + MMGeometry( const QgsGeometry &geom ) : QgsGeometry( geom ) {} + MMGeometry( QgsGeometry &geom ) : QgsGeometry( geom ) {} + + bool operator==( const MMGeometry &rhs ) const + { + return equals( rhs ); + } +}; + +#endif //MMGEOMETRY_H diff --git a/app/guidelinecontroller.cpp b/app/guidelinecontroller.cpp index ce9151ebe..a6fdb26df 100644 --- a/app/guidelinecontroller.cpp +++ b/app/guidelinecontroller.cpp @@ -187,12 +187,12 @@ void GuidelineController::buildGuideline() } } -const QgsGeometry &GuidelineController::guidelineGeometry() const +const MMGeometry &GuidelineController::guidelineGeometry() const { return mGuidelineGeometry; } -void GuidelineController::setGuidelineGeometry( const QgsGeometry &newGuidelineGeometry ) +void GuidelineController::setGuidelineGeometry( const MMGeometry &newGuidelineGeometry ) { if ( mGuidelineGeometry.equals( newGuidelineGeometry ) ) return; diff --git a/app/guidelinecontroller.h b/app/guidelinecontroller.h index 76166fcc6..aea3f5cdc 100644 --- a/app/guidelinecontroller.h +++ b/app/guidelinecontroller.h @@ -37,13 +37,13 @@ class GuidelineController : public QObject Q_PROPERTY( bool allowed READ allowed WRITE setAllowed NOTIFY allowedChanged ) // output properties (real geometry + crosshair position ) in map CRS - Q_PROPERTY( QgsGeometry guidelineGeometry READ guidelineGeometry WRITE setGuidelineGeometry NOTIFY guidelineGeometryChanged ) + Q_PROPERTY( MMGeometry guidelineGeometry READ guidelineGeometry WRITE setGuidelineGeometry NOTIFY guidelineGeometryChanged ) public: explicit GuidelineController( QObject *parent = nullptr ); - const QgsGeometry &guidelineGeometry() const; - void setGuidelineGeometry( const QgsGeometry &newGuidelineGeometry ); + const MMGeometry &guidelineGeometry() const; + void setGuidelineGeometry( const MMGeometry &newGuidelineGeometry ); QPointF crosshairPosition() const; void setCrosshairPosition( QPointF newCrosshairPosition ); @@ -71,7 +71,7 @@ class GuidelineController : public QObject signals: - void guidelineGeometryChanged( const QgsGeometry &guidelineGeometry ); + void guidelineGeometryChanged( const MMGeometry &guidelineGeometry ); void crosshairPositionChanged( QPointF crosshairPosition ); void realGeometryChanged( const QgsGeometry &realGeometry ); @@ -93,7 +93,7 @@ class GuidelineController : public QObject private: - QgsGeometry mGuidelineGeometry; + MMGeometry mGuidelineGeometry; QPointF mCrosshairPosition; QgsGeometry mRealGeometry; InputMapSettings *mMapSettings = nullptr; // not owned diff --git a/app/inpututils.cpp b/app/inpututils.cpp index 855e5b2c2..e13253971 100644 --- a/app/inpututils.cpp +++ b/app/inpututils.cpp @@ -446,14 +446,14 @@ QgsGeometry InputUtils::transformGeometry( const QgsGeometry &geometry, const Qg return transformGeometry( geometry, sourceCRS, targetLayer->crs(), targetLayer->transformContext() ); } -QgsGeometry InputUtils::transformGeometryToMapWithLayer( const QgsGeometry &geometry, QgsVectorLayer *sourceLayer, InputMapSettings *targetSettings ) +MMGeometry InputUtils::transformGeometryToMapWithLayer( const QgsGeometry &geometry, QgsVectorLayer *sourceLayer, InputMapSettings *targetSettings ) { if ( !sourceLayer || !sourceLayer->isValid() || !targetSettings ) { - return QgsGeometry(); + return {}; } - return transformGeometry( geometry, sourceLayer->crs(), targetSettings->destinationCrs(), targetSettings->transformContext() ); + return MMGeometry( transformGeometry( geometry, sourceLayer->crs(), targetSettings->destinationCrs(), targetSettings->transformContext() ) ); } QgsGeometry InputUtils::transformGeometryToMapWithCRS( const QgsGeometry &geometry, const QgsCoordinateReferenceSystem &sourceCRS, InputMapSettings *targetSettings ) @@ -816,9 +816,9 @@ QgsPoint InputUtils::point( double x, double y, double z, double m ) return QgsPoint( x, y, z, m ); } -QgsGeometry InputUtils::emptyGeometry() +MMGeometry InputUtils::emptyGeometry() { - return QgsGeometry(); + return {}; } QgsFeature InputUtils::emptyFeature() @@ -1667,15 +1667,15 @@ QgsRectangle InputUtils::stakeoutPathExtent( return extent; } -QgsGeometry InputUtils::stakeoutGeometry( const QgsPoint &mapPosition, const FeatureLayerPair &target, InputMapSettings *mapSettings ) +MMGeometry InputUtils::stakeoutGeometry( const QgsPoint &mapPosition, const FeatureLayerPair &target, InputMapSettings *mapSettings ) { if ( !mapSettings || !target.isValid() ) - return QgsGeometry(); + return {}; - QgsPointXY targetInLayerCoordinates = target.feature().geometry().asPoint(); - QgsPointXY t = transformPointXY( target.layer()->crs(), mapSettings->destinationCrs(), mapSettings->transformContext(), targetInLayerCoordinates ); + const QgsPointXY targetInLayerCoordinates = target.feature().geometry().asPoint(); + const QgsPointXY t = transformPointXY( target.layer()->crs(), mapSettings->destinationCrs(), mapSettings->transformContext(), targetInLayerCoordinates ); - QVector points { mapPosition, QgsPoint( t ) }; + const QVector points { mapPosition, QgsPoint( t ) }; return QgsGeometry::fromPolyline( points ); } diff --git a/app/inpututils.h b/app/inpututils.h index d94e1803e..87a0a2f57 100644 --- a/app/inpututils.h +++ b/app/inpututils.h @@ -38,6 +38,7 @@ #include "inputmapsettings.h" #include "featurelayerpair.h" #include "qgscoordinateformatter.h" +#include "externalTypes/mmgeometry.h" #include "position/mapposition.h" class QgsFeature; @@ -114,7 +115,7 @@ class InputUtils: public QObject static QgsGeometry transformGeometry( const QgsGeometry &geometry, const QgsCoordinateReferenceSystem &sourceCRS, const QgsCoordinateReferenceSystem &destinationCRS, const QgsCoordinateTransformContext &context ); //! Helper methods to use for transforming geometry from QML as overriding does not work properly there - Q_INVOKABLE static QgsGeometry transformGeometryToMapWithLayer( const QgsGeometry &geometry, QgsVectorLayer *sourceLayer, InputMapSettings *targetSettings ); + Q_INVOKABLE static MMGeometry transformGeometryToMapWithLayer( const QgsGeometry &geometry, QgsVectorLayer *sourceLayer, InputMapSettings *targetSettings ); Q_INVOKABLE static QgsGeometry transformGeometryToMapWithCRS( const QgsGeometry &geometry, const QgsCoordinateReferenceSystem &sourceCRS, InputMapSettings *targetSettings ); /** @@ -270,7 +271,7 @@ class InputUtils: public QObject /** * Creates empty geometry */ - Q_INVOKABLE static QgsGeometry emptyGeometry(); + Q_INVOKABLE static MMGeometry emptyGeometry(); /** * Creates empty feature @@ -522,7 +523,7 @@ class InputUtils: public QObject Q_INVOKABLE QgsRectangle stakeoutPathExtent( MapPosition *mapPosition, const FeatureLayerPair &targetFeature, InputMapSettings *mapSettings, double mapExtentOffset ); //! Returns geometry created out of the two points and converts it to map canvas screen pixels. - Q_INVOKABLE static QgsGeometry stakeoutGeometry( const QgsPoint &mapPosition, const FeatureLayerPair &target, InputMapSettings *mapSettings ); + Q_INVOKABLE static MMGeometry stakeoutGeometry( const QgsPoint &mapPosition, const FeatureLayerPair &target, InputMapSettings *mapSettings ); // Translates distance to target point into scale factor that should be used for map canvas during stakeout qreal distanceToScale( qreal distance ); diff --git a/app/mapsketchingcontroller.cpp b/app/mapsketchingcontroller.cpp index af5cf5010..a8c39799e 100644 --- a/app/mapsketchingcontroller.cpp +++ b/app/mapsketchingcontroller.cpp @@ -44,7 +44,7 @@ void MapSketchingController::updateHighlight( const QPointF &oldPoint, const QPo ls->addZValue(); ls->addMValue(); QgsMultiLineString *mls = new QgsMultiLineString( QList() << ls ); - mHighlight = QgsGeometry( mls ); + mHighlight = MMGeometry( mls ); mScreenPoints = QgsGeometry( new QgsLineString( { QgsPointXY( oldPoint.x(), oldPoint.y() ) } ) ); } @@ -139,7 +139,7 @@ void MapSketchingController::undo() const mLayer->undoStack()->undo(); } -QgsGeometry MapSketchingController::highlightGeometry() const +MMGeometry MapSketchingController::highlightGeometry() const { return mHighlight; } @@ -152,7 +152,7 @@ QStringList MapSketchingController::availableColors() const void MapSketchingController::clearHighlight() { - mHighlight = QgsGeometry( new QgsMultiLineString() ); + mHighlight = MMGeometry( new QgsMultiLineString() ); emit highlightGeometryChanged(); } diff --git a/app/mapsketchingcontroller.h b/app/mapsketchingcontroller.h index ab0488571..73923d631 100644 --- a/app/mapsketchingcontroller.h +++ b/app/mapsketchingcontroller.h @@ -13,6 +13,7 @@ #include #include "qgsgeometry.h" +#include "externalTypes/mmgeometry.h" class QgsVectorLayer; class InputMapSettings; @@ -22,7 +23,7 @@ class MapSketchingController : public QObject Q_OBJECT Q_PROPERTY( InputMapSettings *mapSettings READ mapSettings WRITE setMapSettings NOTIFY mapSettingsChanged ) - Q_PROPERTY( QgsGeometry highlightGeometry READ highlightGeometry NOTIFY highlightGeometryChanged ) + Q_PROPERTY( MMGeometry highlightGeometry READ highlightGeometry NOTIFY highlightGeometryChanged ) Q_PROPERTY( QColor activeColor READ activeColor WRITE setActiveColor NOTIFY activeColorChanged ) Q_PROPERTY( bool canRedo READ canRedo NOTIFY canRedoChanged ) Q_PROPERTY( bool canUndo READ canUndo NOTIFY canUndoChanged ) @@ -51,7 +52,7 @@ class MapSketchingController : public QObject void eraserActiveChanged(); private: - QgsGeometry highlightGeometry() const; + MMGeometry highlightGeometry() const; void clearHighlight(); void setMapSettings( InputMapSettings *settings ); InputMapSettings *mapSettings() const; @@ -65,7 +66,7 @@ class MapSketchingController : public QObject InputMapSettings *mMapSettings = nullptr; QgsVectorLayer *mLayer = nullptr; - QgsGeometry mHighlight; + MMGeometry mHighlight; QgsGeometry mScreenPoints; QColor mColor; diff --git a/app/maptools/measurementmaptool.cpp b/app/maptools/measurementmaptool.cpp index d9ce8680e..d30f80514 100644 --- a/app/maptools/measurementmaptool.cpp +++ b/app/maptools/measurementmaptool.cpp @@ -178,17 +178,17 @@ void MeasurementMapTool::updateMapSettings( InputMapSettings *newMapSettings ) } } -const QgsGeometry &MeasurementMapTool::recordedGeometry() const +const MMGeometry &MeasurementMapTool::recordedGeometry() const { return mRecordedGeometry; } -QgsGeometry MeasurementMapTool::existingVertices() const +MMGeometry MeasurementMapTool::existingVertices() const { return mExistingVertices; } -void MeasurementMapTool::setExistingVertices( const QgsGeometry &vertices ) +void MeasurementMapTool::setExistingVertices( const MMGeometry &vertices ) { if ( mExistingVertices.equals( vertices ) ) return; @@ -273,7 +273,7 @@ void MeasurementMapTool::setMeasurementFinalized( bool newMeasurementFinalized ) emit measurementFinalizedChanged( mMeasurementFinalized ); } -void MeasurementMapTool::setRecordedGeometry( const QgsGeometry &newRecordedGeometry ) +void MeasurementMapTool::setRecordedGeometry( const MMGeometry &newRecordedGeometry ) { if ( mRecordedGeometry.equals( newRecordedGeometry ) ) return; diff --git a/app/maptools/measurementmaptool.h b/app/maptools/measurementmaptool.h index 1d041b203..f7c5fe31b 100644 --- a/app/maptools/measurementmaptool.h +++ b/app/maptools/measurementmaptool.h @@ -19,6 +19,7 @@ #include "qgsgeometry.h" #include "qgsvectorlayer.h" #include "qgsmultipoint.h" +#include "externalTypes/mmgeometry.h" const double CLOSE_THRESHOLD = 10.0; // in pixels @@ -26,8 +27,8 @@ class MeasurementMapTool : public AbstractMapTool { Q_OBJECT - Q_PROPERTY( QgsGeometry recordedGeometry READ recordedGeometry WRITE setRecordedGeometry NOTIFY recordedGeometryChanged ) - Q_PROPERTY( QgsGeometry existingVertices READ existingVertices WRITE setExistingVertices NOTIFY existingVerticesChanged ) + Q_PROPERTY( MMGeometry recordedGeometry READ recordedGeometry WRITE setRecordedGeometry NOTIFY recordedGeometryChanged ) + Q_PROPERTY( MMGeometry existingVertices READ existingVertices WRITE setExistingVertices NOTIFY existingVerticesChanged ) Q_PROPERTY( QPointF crosshairPoint READ crosshairPoint WRITE setCrosshairPoint NOTIFY crosshairPointChanged ) Q_PROPERTY( double lengthWithGuideline READ lengthWithGuideline WRITE setLengthWithGuideline NOTIFY lengthWithGuidelineChanged ) @@ -93,11 +94,11 @@ class MeasurementMapTool : public AbstractMapTool bool measurementFinalized() const; void setMeasurementFinalized( bool newMeasurementFinalized ); - const QgsGeometry &recordedGeometry() const; - void setRecordedGeometry( const QgsGeometry &newRecordedGeometry ); + const MMGeometry &recordedGeometry() const; + void setRecordedGeometry( const MMGeometry &newRecordedGeometry ); - QgsGeometry existingVertices() const; - void setExistingVertices( const QgsGeometry &vertices ); + MMGeometry existingVertices() const; + void setExistingVertices( const MMGeometry &vertices ); void resetMapSettings(); void updateMapSettings( InputMapSettings *newMapSettings ); @@ -109,8 +110,8 @@ class MeasurementMapTool : public AbstractMapTool void canUndoChanged( bool canUndo ); void canCloseShapeChanged( bool canUndo ); void measurementFinalizedChanged( bool measurementFinalized ); - void recordedGeometryChanged( const QgsGeometry &recordedGeometry ); - void existingVerticesChanged( const QgsGeometry &vertices ); + void recordedGeometryChanged( const MMGeometry &recordedGeometry ); + void existingVerticesChanged( const MMGeometry &vertices ); void crosshairPointChanged( const QPointF &crosshairPoint ); void isValidGeometryChanged( bool canFinalize ); @@ -123,8 +124,8 @@ class MeasurementMapTool : public AbstractMapTool private: QVector mPoints; - QgsGeometry mRecordedGeometry; - QgsGeometry mExistingVertices; + MMGeometry mRecordedGeometry; + MMGeometry mExistingVertices; QgsDistanceArea mDistanceArea; QPointF mCrosshairPoint; double mLengthWithGuideline = 0; diff --git a/app/multieditmanager.h b/app/multieditmanager.h index 134d4ef37..ff811eebb 100644 --- a/app/multieditmanager.h +++ b/app/multieditmanager.h @@ -14,6 +14,7 @@ #include "featurelayerpair.h" #include "staticfeaturesmodel.h" +#include "externalTypes/mmgeometry.h" class QgsVectorLayer; @@ -30,7 +31,7 @@ class MultiEditManager : public QObject Q_PROPERTY( QgsVectorLayer *layer MEMBER mLayer NOTIFY layerChanged ) Q_PROPERTY( StaticFeaturesModel *model READ model CONSTANT ) - Q_PROPERTY( QgsGeometry geometry READ collectGeometry NOTIFY geometryChanged ) + Q_PROPERTY( MMGeometry geometry READ collectGeometry NOTIFY geometryChanged ) Q_PROPERTY( InputMapSettings *mapSettings MEMBER mMapSettings ) public: @@ -49,7 +50,7 @@ class MultiEditManager : public QObject Q_INVOKABLE void deleteSelectedFeatures(); //! Returns multipart geometry of all geometries in the model, in map crs - QgsGeometry collectGeometry() const { return mModel->collectGeometries( mMapSettings ); } + MMGeometry collectGeometry() const { return mModel->collectGeometries( mMapSettings ); } StaticFeaturesModel *model() const { return mModel.get(); } diff --git a/app/position/tracking/positiontrackinghighlight.cpp b/app/position/tracking/positiontrackinghighlight.cpp index 4ad84b270..1cd3fef7c 100644 --- a/app/position/tracking/positiontrackinghighlight.cpp +++ b/app/position/tracking/positiontrackinghighlight.cpp @@ -9,6 +9,8 @@ #include "positiontrackinghighlight.h" +#include "inpututils.h" + PositionTrackingHighlight::PositionTrackingHighlight( QObject *parent ) : QObject( parent ) { @@ -20,20 +22,20 @@ void PositionTrackingHighlight::recalculate() { if ( mMapPosition.isEmpty() ) { - setHighlightGeometry( QgsGeometry() ); + setHighlightGeometry( InputUtils::emptyGeometry() ); return; } if ( mTrackedGeometry.isEmpty() ) { - setHighlightGeometry( QgsGeometry() ); + setHighlightGeometry( InputUtils::emptyGeometry() ); return; } // add map position to the end of the tracked geometry // note - map position must be in the same CRS as the tracked geometry - QgsGeometry highlightGeometry( mTrackedGeometry ); + MMGeometry highlightGeometry( mTrackedGeometry ); QgsVertexId lastVertex( 0, 0, highlightGeometry.constGet()->vertexCount() ); highlightGeometry.get()->insertVertex( lastVertex, mMapPosition ); @@ -55,12 +57,12 @@ void PositionTrackingHighlight::setTrackedGeometry( const QgsGeometry &newTracke emit trackedGeometryChanged( mTrackedGeometry ); } -QgsGeometry PositionTrackingHighlight::highlightGeometry() const +MMGeometry PositionTrackingHighlight::highlightGeometry() const { return mHighlightGeometry; } -void PositionTrackingHighlight::setHighlightGeometry( const QgsGeometry &newHighlightGeometry ) +void PositionTrackingHighlight::setHighlightGeometry( const MMGeometry &newHighlightGeometry ) { if ( mHighlightGeometry.equals( newHighlightGeometry ) ) return; diff --git a/app/position/tracking/positiontrackinghighlight.h b/app/position/tracking/positiontrackinghighlight.h index 396f1a7ed..db4dc99da 100644 --- a/app/position/tracking/positiontrackinghighlight.h +++ b/app/position/tracking/positiontrackinghighlight.h @@ -14,6 +14,7 @@ #include #include "qgsgeometry.h" +#include "externalTypes/mmgeometry.h" class PositionTrackingHighlight : public QObject { @@ -25,7 +26,7 @@ class PositionTrackingHighlight : public QObject Q_PROPERTY( QgsGeometry trackedGeometry READ trackedGeometry WRITE setTrackedGeometry NOTIFY trackedGeometryChanged ) // Geometry out - Q_PROPERTY( QgsGeometry highlightGeometry READ highlightGeometry NOTIFY highlightGeometryChanged ) + Q_PROPERTY( MMGeometry highlightGeometry READ highlightGeometry NOTIFY highlightGeometryChanged ) public: explicit PositionTrackingHighlight( QObject *parent = nullptr ); @@ -33,7 +34,7 @@ class PositionTrackingHighlight : public QObject QgsGeometry trackedGeometry() const; void setTrackedGeometry( const QgsGeometry &newTrackedGeometry ); - QgsGeometry highlightGeometry() const; + MMGeometry highlightGeometry() const; QgsPoint mapPosition() const; void setMapPosition( QgsPoint newMapPosition ); @@ -43,15 +44,15 @@ class PositionTrackingHighlight : public QObject signals: void trackedGeometryChanged( QgsGeometry trackedGeometry ); - void highlightGeometryChanged( QgsGeometry highlightGeometry ); + void highlightGeometryChanged( MMGeometry highlightGeometry ); void mapPositionChanged( QgsPoint mapPosition ); private: - void setHighlightGeometry( const QgsGeometry &newHighlightGeometry ); + void setHighlightGeometry( const MMGeometry &newHighlightGeometry ); QgsGeometry mTrackedGeometry; - QgsGeometry mHighlightGeometry; + MMGeometry mHighlightGeometry; QgsPoint mMapPosition; }; diff --git a/app/qml/map/MMHighlight.qml b/app/qml/map/MMHighlight.qml index 7c813c1cc..affa6da97 100644 --- a/app/qml/map/MMHighlight.qml +++ b/app/qml/map/MMHighlight.qml @@ -9,8 +9,10 @@ import QtQuick import QtQuick.Shapes +import QtQml import mm 1.0 as MM +import MMInput import ".." @@ -19,7 +21,7 @@ Item { // geometry to highlight // geometry must be in map canvas CRS! - property var geometry + property mmGeometry geometry // for transformation of the highlight to the correct location on the map property MM.MapSettings mapSettings @@ -108,7 +110,7 @@ Item { { if ( !mapSettings ) return - if ( !geometry ) + if ( __inputUtils.isEmptyGeometry( geometry ) ) { // trigger repaint for empty geometries markerItems = markerItems.map( function (marker) { return marker.destroy() } ) diff --git a/app/qml/map/MMMapController.qml b/app/qml/map/MMMapController.qml index f3b3601ee..02afcbf78 100644 --- a/app/qml/map/MMMapController.qml +++ b/app/qml/map/MMMapController.qml @@ -1380,7 +1380,7 @@ Item { } function jumpToHighlighted( mapOffset ) { - if ( identifyHighlight.geometry === null ) + if ( identifyHighlight.geometry.isNull ) return let screenPt = __inputUtils.relevantGeometryCenterToScreenCoordinates( identifyHighlight.geometry, mapCanvas.mapSettings ) @@ -1394,7 +1394,7 @@ Item { } function hideHighlight() { - identifyHighlight.geometry = null + identifyHighlight.geometry = __inputUtils.emptyGeometry() updatePosition() } @@ -1441,7 +1441,7 @@ Item { case "view": { // While a feature is highlighted we want to keep it visible in the map extent // so in that case we skip centering to position - if ( identifyHighlight.geometry !== null ) + if ( !__inputUtils.isEmptyGeometry( identifyHighlight.geometry ) ) { break } @@ -1476,7 +1476,7 @@ Item { // clear all previous references to old project (if we don't clear references to the previous project, // highlights may end up with dangling pointers to map layers and cause crashes) - identifyHighlight.geometry = null + identifyHighlight.geometry = __inputUtils.emptyGeometry() } function setTracking( shouldTrack ) { diff --git a/app/qml/map/MMRecordingTools.qml b/app/qml/map/MMRecordingTools.qml index da976654c..22ffd1012 100644 --- a/app/qml/map/MMRecordingTools.qml +++ b/app/qml/map/MMRecordingTools.qml @@ -10,6 +10,8 @@ import QtQuick import QtQuick.Shapes import QtMultimedia +import QtQml +import QtQml.Models import mm 1.0 as MM import MMInput