code: def toggleDrawingSensitive(self, drawing=True):
          
          self.actions.editMode.setEnabled(not drawing)
          if not drawing and self.beginner():
              # Cancel creation.
              print('Cancel creation.')
              self.canvas.setEditing(True)
              self.canvas.restoreCursor()
              self.actions.create.setEnabled(True)
docs: In the middle of drawing, toggling between modes should be disabled.