Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
09733942
Unverified
Commit
09733942
authored
Jun 01, 2018
by
Gus Grubba
Committed by
GitHub
Jun 01, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6530 from mavlink/doubleClickToDelete
Use a menu to delete a vertex
parents
4d97eebf
ffe65c58
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
113 additions
and
86 deletions
+113
-86
QGCMapPolygonVisuals.qml
src/MissionManager/QGCMapPolygonVisuals.qml
+86
-56
QGCMapPolylineVisuals.qml
src/MissionManager/QGCMapPolylineVisuals.qml
+21
-23
CorridorScanEditor.qml
src/PlanView/CorridorScanEditor.qml
+6
-7
No files found.
src/MissionManager/QGCMapPolygonVisuals.qml
View file @
09733942
...
...
@@ -186,6 +186,59 @@ Item {
}
}
Menu
{
id
:
menu
property
int
_removeVertexIndex
function
popUpWithIndex
(
curIndex
)
{
_removeVertexIndex
=
curIndex
removeVertexItem
.
visible
=
(
mapPolygon
.
count
>
3
&&
_removeVertexIndex
>=
0
)
menu
.
popup
()
}
MenuItem
{
id
:
removeVertexItem
text
:
qsTr
(
"
Remove vertex
"
)
onTriggered
:
{
if
(
menu
.
_removeVertexIndex
>=
0
)
{
mapPolygon
.
removeVertex
(
menu
.
_removeVertexIndex
)
}
}
}
MenuSeparator
{
visible
:
removeVertexItem
.
visible
}
MenuItem
{
text
:
qsTr
(
"
Circle
"
)
onTriggered
:
resetCircle
()
}
MenuItem
{
text
:
qsTr
(
"
Polygon
"
)
onTriggered
:
resetPolygon
()
}
MenuItem
{
text
:
qsTr
(
"
Set radius...
"
)
visible
:
_circle
onTriggered
:
radiusDialog
.
visible
=
true
}
MenuItem
{
text
:
qsTr
(
"
Edit position...
"
)
enabled
:
_circle
onTriggered
:
qgcView
.
showDialog
(
editPositionDialog
,
qsTr
(
"
Edit Position
"
),
qgcView
.
showDialogDefaultWidth
,
StandardButton
.
Cancel
)
}
MenuItem
{
text
:
qsTr
(
"
Load KML...
"
)
onTriggered
:
kmlLoadDialog
.
openForLoad
()
}
}
Component
{
id
:
polygonComponent
...
...
@@ -291,32 +344,36 @@ Item {
}
}
onClicked
:
mapPolygon
.
removeVertex
(
polygonVertex
)
onClicked
:
{
menu
.
popUpWithIndex
(
polygonVertex
)
}
}
}
Component
{
id
:
centerDragHandle
MapQuickItem
{
id
:
mapQuickItem
anchorPoint.x
:
dragHandle
.
width
/
2
anchorPoint.y
:
dragHandle
.
height
/
2
anchorPoint.x
:
dragHandle
.
width
*
0.5
anchorPoint.y
:
dragHandle
.
height
*
0.5
z
:
_zorderDragHandle
sourceItem
:
Rectangle
{
id
:
dragHandle
width
:
ScreenTools
.
defaultFontPixelHeight
*
1.5
height
:
width
radius
:
width
/
2
color
:
"
white
"
opacity
:
.
90
QGCLabel
{
anchors.horizontalCenter
:
parent
.
horizontalCenter
anchors.verticalCenter
:
parent
.
verticalCenter
text
:
"
...
"
color
:
"
black
"
id
:
dragHandle
width
:
ScreenTools
.
defaultFontPixelHeight
*
1.5
height
:
width
radius
:
width
*
0.5
color
:
Qt
.
rgba
(
1
,
1
,
1
,
0.8
)
border.color
:
Qt
.
rgba
(
0
,
0
,
0
,
0.25
)
border.width
:
1
QGCColoredImage
{
width
:
parent
.
width
height
:
width
color
:
Qt
.
rgba
(
0
,
0
,
0
,
1
)
mipmap
:
true
fillMode
:
Image
.
PreserveAspectFit
source
:
"
/qmlimages/MapCenter.svg
"
sourceSize.height
:
height
anchors.centerIn
:
parent
}
}
}
...
...
@@ -327,7 +384,7 @@ Item {
MapQuickItem
{
id
:
mapQuickItem
anchorPoint.x
:
dragHandle
.
width
/
2
anchorPoint.x
:
dragHandle
.
width
/
2
anchorPoint.y
:
dragHandle
.
height
/
2
z
:
_zorderDragHandle
visible
:
!
_circle
...
...
@@ -335,12 +392,13 @@ Item {
property
int
polygonVertex
sourceItem
:
Rectangle
{
id
:
dragHandle
width
:
ScreenTools
.
defaultFontPixelHeight
*
1.5
height
:
width
radius
:
width
/
2
color
:
"
white
"
opacity
:
.
90
id
:
dragHandle
width
:
ScreenTools
.
defaultFontPixelHeight
*
1.5
height
:
width
radius
:
width
*
0.5
color
:
Qt
.
rgba
(
1
,
1
,
1
,
0.8
)
border.color
:
Qt
.
rgba
(
0
,
0
,
0
,
0.25
)
border.width
:
1
}
}
}
...
...
@@ -393,44 +451,16 @@ Item {
onItemCoordinateChanged
:
mapPolygon
.
center
=
itemCoordinate
onDragStart
:
mapPolygon
.
centerDrag
=
true
onDragStop
:
mapPolygon
.
centerDrag
=
false
onClicked
:
menu
.
popup
()
onClicked
:
{
menu
.
popUpWithIndex
(
-
1
)
//-- Don't offer a choice to delete vertex (cur index == -1)
}
function
setRadiusFromDialog
()
{
setCircleRadius
(
mapPolygon
.
center
,
radiusField
.
text
)
radiusDialog
.
visible
=
false
}
Menu
{
id
:
menu
MenuItem
{
text
:
qsTr
(
"
Circle
"
)
onTriggered
:
resetCircle
()
}
MenuItem
{
text
:
qsTr
(
"
Polygon
"
)
onTriggered
:
resetPolygon
()
}
MenuItem
{
text
:
qsTr
(
"
Set radius...
"
)
visible
:
_circle
onTriggered
:
radiusDialog
.
visible
=
true
}
MenuItem
{
text
:
qsTr
(
"
Edit position...
"
)
enabled
:
_circle
onTriggered
:
qgcView
.
showDialog
(
editPositionDialog
,
qsTr
(
"
Edit Position
"
),
qgcView
.
showDialogDefaultWidth
,
StandardButton
.
Cancel
)
}
MenuItem
{
text
:
qsTr
(
"
Load KML...
"
)
onTriggered
:
kmlLoadDialog
.
openForLoad
()
}
}
Rectangle
{
id
:
radiusDialog
anchors.margins
:
_margin
...
...
src/MissionManager/QGCMapPolylineVisuals.qml
View file @
09733942
...
...
@@ -128,12 +128,22 @@ Item {
Menu
{
id
:
menu
property
int
_removeVertexIndex
property
int
removeVertex
function
popUpWithIndex
(
curIndex
)
{
_removeVertexIndex
=
curIndex
removeVertexItem
.
visible
=
mapPolyline
.
count
>
2
menu
.
popup
()
}
MenuItem
{
id
:
removeVertexItem
text
:
qsTr
(
"
Remove vertex
"
)
onTriggered
:
mapPolyline
.
removeVertex
(
parent
.
removeVertex
)
onTriggered
:
mapPolyline
.
removeVertex
(
menu
.
_removeVertexIndex
)
}
MenuSeparator
{
visible
:
removeVertexItem
.
visible
}
MenuItem
{
...
...
@@ -167,7 +177,7 @@ Item {
width
:
ScreenTools
.
defaultFontPixelHeight
*
1.5
height
:
width
radius
:
width
/
2
border.color
:
"
white
"
border.color
:
"
white
"
color
:
"
transparent
"
opacity
:
.
50
z
:
_zorderSplitHandle
...
...
@@ -243,12 +253,7 @@ Item {
}
onClicked
:
{
if
(
polylineVertex
==
0
)
{
menu
.
removeVertex
=
polylineVertex
menu
.
popup
()
}
else
{
mapPolyline
.
removeVertex
(
polylineVertex
)
}
menu
.
popUpWithIndex
(
polylineVertex
)
}
}
...
...
@@ -266,20 +271,13 @@ Item {
property
int
polylineVertex
sourceItem
:
Rectangle
{
id
:
dragHandle
width
:
ScreenTools
.
defaultFontPixelHeight
*
1.5
height
:
width
radius
:
width
/
2
color
:
"
white
"
opacity
:
.
90
QGCLabel
{
anchors.horizontalCenter
:
parent
.
horizontalCenter
anchors.verticalCenter
:
parent
.
verticalCenter
text
:
"
...
"
color
:
"
black
"
visible
:
polylineVertex
==
0
}
id
:
dragHandle
width
:
ScreenTools
.
defaultFontPixelHeight
*
1.5
height
:
width
radius
:
width
*
0.5
color
:
Qt
.
rgba
(
1
,
1
,
1
,
0.8
)
border.color
:
Qt
.
rgba
(
0
,
0
,
0
,
0.25
)
border.width
:
1
}
}
}
...
...
src/PlanView/CorridorScanEditor.qml
View file @
09733942
...
...
@@ -108,11 +108,11 @@ Rectangle {
QGCCheckBox
{
id
:
relAlt
anchors.left
:
parent
.
left
text
:
qsTr
(
"
Relative altitude
"
)
checked
:
missionItem
.
cameraCalc
.
distanceToSurfaceRelative
enabled
:
missionItem
.
cameraCalc
.
isManualCamera
&&
!
missionItem
.
followTerrain
visible
:
QGroundControl
.
corePlugin
.
options
.
showMissionAbsoluteAltitude
||
(
!
missionItem
.
cameraCalc
.
distanceToSurfaceRelative
&&
!
missionItem
.
followTerrain
)
Layout.alignment
:
Qt
.
AlignLeft
Layout.columnSpan
:
2
onClicked
:
missionItem
.
cameraCalc
.
distanceToSurfaceRelative
=
checked
...
...
@@ -148,12 +148,11 @@ Rectangle {
}
GridLayout
{
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
columnSpacing
:
_margin
rowSpacing
:
_margin
columns
:
2
visible
:
followsTerrainCheckBox
.
checked
Layout.fillWidth
:
true
columnSpacing
:
_margin
rowSpacing
:
_margin
columns
:
2
visible
:
followsTerrainCheckBox
.
checked
QGCLabel
{
text
:
qsTr
(
"
Tolerance
"
)
}
FactTextField
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment