code: def mouseReleaseEvent(self, event):
          
          # ignore events when the scene is in view mode
          scene = self.scene()
          if scene and (scene.inViewMode() or scene.isConnecting()):
              event.ignore()
              return
  
          # emit the scene's connection menu requested signal if
          # the button was a right mouse button
          if event.button() == Qt.RightButton and scene:
              scene.emitConnectionMenuRequested(self)
              event.accept()
          else:
              super(XNodeConnection, self).mouseReleaseEvent(event)
  
          # unblock the selection signals
          if scene:
              scene.blockSelectionSignals(False)
docs: Overloads the mouse release event to ignore the event when the \
          scene is in view mode, and release the selection block signal.
           
           :param     event   <QMouseReleaseEvent>