From 2cb7fafb6c9e29bb24b61e4cc1c9de86da1d1096 Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Tue, 30 Apr 2019 09:19:57 -0700 Subject: [PATCH] Fix Menu crash caused by parenting --- ChangeLog.md | 1 + src/PlanView/GeoFenceMapVisuals.qml | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/ChangeLog.md b/ChangeLog.md index 98a47c4f4..468917cc0 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -9,6 +9,7 @@ Note: This file only contains high level features or important fixes. * Major rewrite and bug fix pass through Structure Scan. Previous version had such bad problems that it can no longer be supported. Plans with Structure Scan will need to be recreated. New QGC will not load old Structure Scan plans. ### 3.5.3 - Not yet released +* Fix crash when clicking on GeoFence polygon vertex * PX4: Fix missing ```MC_YAW_FF``` parameter in PID Tuning * ArduPilot: Fix parameter file save generating bad characters from git hash diff --git a/src/PlanView/GeoFenceMapVisuals.qml b/src/PlanView/GeoFenceMapVisuals.qml index 371a64a4c..ad825da4b 100644 --- a/src/PlanView/GeoFenceMapVisuals.qml +++ b/src/PlanView/GeoFenceMapVisuals.qml @@ -20,6 +20,7 @@ import QGroundControl.FlightMap 1.0 /// GeoFence map visuals Item { + id: _root z: QGroundControl.zOrderMapItems property var map @@ -99,10 +100,15 @@ Item { } } + // By default the parent for Instantiator.delegate item is the Instatiator itself. By there is a bug + // in Qt which will cause a crash if this delete item has Menu item within it. Since the Menu item + // doesn't like having a non-visual item as parent. This is likely related to hybrid QQuickWidtget+QML + // Hence Qt folks are going to care. In order to workaround you have to parent the item to _root Item instead. Instantiator { model: _polygons delegate : QGCMapPolygonVisuals { + parent: _root mapControl: map mapPolygon: object borderWidth: object.inclusion ? _borderWidthInclusion : _borderWidthExclusion @@ -116,6 +122,7 @@ Item { model: _circles delegate : QGCMapCircleVisuals { + parent: _root mapControl: map mapCircle: object borderWidth: object.inclusion ? _borderWidthInclusion : _borderWidthExclusion -- 2.22.0