def unhighlight(self): self._ellipseItem.setBrush(QtGui.QBrush(self._color)) self._ellipseItem.setRect( -self.__radius, -self.__radius, self.__diameter, self.__diameter, )
def highlight(self): self._ellipseItem.setBrush(QtGui.QBrush(self._color.lighter())) # make the port bigger to highlight it can accept the connection. self._ellipseItem.setRect( -self.__radius * 1.3, -self.__radius * 1.3, self.__diameter * 1.3, self.__diameter * 1.3, )
def setColor(self, color): self._color = color self._ellipseItem.setBrush(QtGui.QBrush(self._color))