Implementing the track editing mode
Our final task for this chapter is to implement the track editing mode. We learned in the previous chapter how we can turn on the editing mode for a map layer and then use various map tools to let the user add, edit, and delete features. We'll start to implement the actual map tools in Chapter 9, Completing the ForestTrails Application, but for now, let's define our track editing mode itself.
The setEditMode()
method is used to enter and leave the track editing mode. Replace the placeholder method you defined earlier with this new implementation:
def setEditMode(self): if self.editing: if self.modified: reply = QMessageBox.question(self, "Confirm", "Save Changes?", QMessageBox.Yes | QMessageBox.No, QMessageBox.Yes) if reply...