code: def reject(self):
          
          self.canvas.unsetMapTool(self.tool)
          if self.previous_map_tool != self.tool:
              self.canvas.setMapTool(self.previous_map_tool)
          self.tool.reset()
          self.extent_selector_closed.emit()
          super(ExtentSelectorDialog, self).reject()
docs: User rejected the rectangle.