def __init__(self, parentCCPath, staticExportItem):
#super().__init__(0,-1*parentCCPath.rect().height(),0, parentCCPath.rect().height()) #x1, y1, x2, y2
super().__init__(0,-1, 0, parentCCPath.rect().height() + 4) #x1, y1, x2, y2
assert not self.line().isNull() #needed to do self.line().setLength(x)
self.parentCCPath = parentCCPath
self.staticExportItem = staticExportItem
self.setFlags(QtWidgets.QGraphicsItem.ItemIsMovable|QtWidgets.QGraphicsItem.ItemSendsGeometryChanges|QtWidgets.QGraphicsItem.ItemIsFocusable|QtWidgets.QGraphicsItem.ItemClipsToShape)
self.setAcceptHoverEvents(True)
self.setCursor(QtCore.Qt.SizeHorCursor)
#self.setBrush(QtGui.QColor("red"))
pen = QtGui.QPen() # creates a default pen
if not self.staticExportItem["exportsAllItems"]:
pen.setStyle(QtCore.Qt.DotLine)
pen.setWidth(2)
self.setPen(pen)
self.inactivePen = pen
self.inactivePen.setColor(QtGui.QColor("black"))
self.activePen = QtGui.QPen(pen)
self.activePen.setColor(QtGui.QColor("cyan"))
评论列表
文章目录