timeline.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:Laborejo 作者: hilbrichtsoftware 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号