def mouseMoveEvent(self, event):
self.unhighlight()
scenePos = self.mapToScene(event.pos())
# When clicking on an UI port label, it is ambigous which connection point should be activated.
# We let the user drag the mouse in either direction to select the conneciton point to activate.
delta = scenePos - self.__mousDownPos
if delta.x() < 0:
if self.__port.inCircle() is not None:
self.__port.inCircle().mousePressEvent(event)
else:
if self.__port.outCircle() is not None:
self.__port.outCircle().mousePressEvent(event)
# def paint(self, painter, option, widget):
# super(PortLabel, self).paint(painter, option, widget)
# painter.setPen(QtGui.QPen(QtGui.QColor(0, 0, 255)))
# painter.drawRect(self.windowFrameRect())
评论列表
文章目录