code: def delMargin(self, name):
          
          for index, margin in enumerate(self._margins):
              if margin.getName() == name:
                  visible = margin.isVisible()
                  margin.clear()
                  margin.deleteLater()
                  del self._margins[index]
                  if visible:
                      self.updateViewport()
                  return True
          return False
docs: Deletes a margin.
             Returns True if the margin was deleted and False otherwise.