code: def update_extent_from_rectangle(self):
          
  
          self.show()
          self.canvas.unsetMapTool(self.rectangle_map_tool)
          self.canvas.setMapTool(self.pan_tool)
  
          rectangle = self.rectangle_map_tool.rectangle()
          if rectangle:
              self.bounding_box_group.setTitle(
                  self.tr('Bounding box from rectangle'))
              extent = rectangle_geo_array(rectangle, self.iface.mapCanvas())
              self.update_extent(extent)
docs: Update extent value in GUI based from the QgsMapTool rectangle.
  
          .. note:: Delegates to update_extent()