timeline.py 文件源码

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

项目:Laborejo 作者: hilbrichtsoftware 项目源码 文件源码
def deactivate_contextMenuEvent(self, event):
        menu = QtWidgets.QMenu()

        listOfLabelsAndFunctions = [
            ("restore to full duration ", self.contextRestore),
            ]

        for text, function in listOfLabelsAndFunctions:
            if text == "separator":
                self.addSeparator()
            else:
                a = QtWidgets.QAction(text, menu)
                menu.addAction(a)
                a.triggered.connect(function)

        pos = QtGui.QCursor.pos()
        pos.setY(pos.y() + 5)
        self.ungrabMouse() #if we don't ungrab and the user clicks the context menu "away" by clicking in an empty area this will still get registered as mouseclick belonging to the current item
        menu.exec_(pos)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号