Hi.
I try to delete Graphics in QML.
My code is
onMouseClicked: {
clickPointBuilder.points.addPoint(cPoint)
wayPointMakeGraphic.geometry = clickPointBuilder.geometry
clickPointLineBuilder.addPoint(cPoint)
wayPointLineMakeGraphic.geometry = clickPointLineBuilder.geometry
}
Item{
focus: true
if(event.key === Qt.Key_C){
console.log("OK CLEAR")
clickPointBuilder.points.removeAll()
clickPointLineBuilder.parts.removeAll()
}
}But, This code have a flaw.
I want to delete it when I press the C Key.
It will be deleted when I click the screen again after pressing the C key.
How to delete Graphics?