def mouseReleaseEvent(self, event): self.drag_is_not_DND = False if self.drag is None: QTreeView.mousePressEvent(self, self.mouse_press_event) self.drag = None QTreeView.mouseReleaseEvent(self, event)