def mouseDoubleClickEvent( self, event: QtWidgets.QGraphicsSceneMouseEvent) -> None: """Intercept events and pass to overlay.""" view_pos = event.widget().mapFromGlobal(event.screenPos()) for item in self.overlayitems: if item.contains(view_pos, event.widget().rect()): item.item.mouseDoubleClickEvent(event)
def mouseMoveEvent(self, event: QGraphicsSceneMouseEvent): if (QLineF(event.screenPos(), event.buttonDownScreenPos( Qt.LeftButton)).length() < QApplication.startDragDistance()): return self.parentItem().edgeDragStart() package = QMimeData() package.setData(self.DragMimeType, bytes()) drag = QDrag(event.widget()) drag.setMimeData(package) drag.exec_() self.parentItem().edgeDragStop()