def __init__(self, parentTempoTrack, staticExportItem):
super().__init__("") #x,y,w,h
self.staticExportItem = staticExportItem
self.parentTempoTrack = parentTempoTrack
if not self.staticExportItem["positionInBlock"] == 0:
self.setAcceptHoverEvents(True)
self.setFlags(QtWidgets.QGraphicsItem.ItemIsMovable)
self.setCursor(QtCore.Qt.SizeHorCursor) #this sets the cursor while the mouse is over the item. It is independent of AcceptHoverEvents
else:
self.ungrabMouse = api.nothing #to surpress a warning from the context menu
self.setFont(constantsAndConfigs.musicFont)
self.setHtml("<font color='black' size='6'>{}</font>".format(constantsAndConfigs.realNoteDisplay[staticExportItem["referenceTicks"]]))
self.number = QtWidgets.QGraphicsTextItem("")
self.number.setParentItem(self)
self.number.setHtml("<font color='black' size='2'>{}</font>".format(str(int(staticExportItem["unitsPerMinute"]))))
self.number.setPos(0,0)
if not self.staticExportItem["graphType"] == "standalone":
self.arrow = QtWidgets.QGraphicsSimpleTextItem("?") #unicode long arrow right #http://xahlee.info/comp/unicode_arrows.html
self.arrow.setParentItem(self)
self.arrow.setPos(13,30)
评论列表
文章目录