code: def mousePressEvent(self, event):
          
          if event.button() == Qt.LeftButton:
              self._drag_origin = event.pos()
          widget = self.widget
          type(widget).mousePressEvent(widget, event)
docs: Handle the mouse press event for a drag operation.