def CreateAction(self, shortname, function, icon, text, statustext, shortcut, toggle=False):
"""
Helper function to create an action
From Miyamoto
"""
if icon is not None:
act = QtWidgets.QAction(icon, text, self)
else:
act = QtWidgets.QAction(text, self)
if shortcut is not None: act.setShortcut(shortcut)
if statustext is not None: act.setStatusTip(statustext)
if toggle:
act.setCheckable(True)
if function is not None: act.triggered.connect(function)
self.actions[shortname] = act
评论列表
文章目录