def mousePressEvent(self, event): if event.button() == Qt.LeftButton: startItem = find_item_at(self.scene(), event.pos(), type=ChannelAnchor) if startItem is not None: # Start a connection line drag. self.__dragStartItem = startItem self.__tmpLine = None event.accept() return lineItem = find_item_at(self.scene(), event.scenePos(), type=QGraphicsLineItem) if lineItem is not None: # Remove a connection under the mouse for link in self.__links: if link.lineItem == lineItem: self.removeLink(link.output, link.input) event.accept() return QGraphicsWidget.mousePressEvent(self, event)
def mousePressEvent(self, event): if event.button() == Qt.RightButton: pass else: QGraphicsWidget.mousePressEvent(self, event)