本文整理汇总了Python中PySide.QtGui.QAction.setMenu方法的典型用法代码示例。如果您正苦于以下问题:Python QAction.setMenu方法的具体用法?Python QAction.setMenu怎么用?Python QAction.setMenu使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PySide.QtGui.QAction
的用法示例。
在下文中一共展示了QAction.setMenu方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: QtReduceMainWindow
# 需要导入模块: from PySide.QtGui import QAction [as 别名]
# 或者: from PySide.QtGui.QAction import setMenu [as 别名]
#.........这里部分代码省略.........
self.saveAsAct,
self.quitAct,
self.preferencesAct,
self.zoomDefAct,
self.zoomInAct,
self.zoomOutAct,
self.fullScreenAct,
self.insertAboveAct,
self.insertBelowAct,
self.evalAct,
self.abortAct,
self.delOutpAct,
self.rawModelAct,
self.testAct,
self.aboutAct,
self.licenseAct]:
act.setIcon(QtReduceIconSets().icon(act))
def zoomDef(self):
self.controller.view.zoomDef(self.isFullScreen())
def zoomIn(self):
self.controller.view.zoomIn()
def zoomOut(self):
self.controller.view.zoomOut()
def __createActions(self):
# Open ...
self.openAct = QAction(self.tr("Open ..."), self,
iconText=self.tr("Open ..."),
shortcut=QKeySequence(QKeySequence.Open),
triggered=self.open)
self.openAct.setMenu(self.recentFileMenu)
# Save
self.saveAct = QAction(self.tr("Save"), self,
shortcut=QKeySequence(QKeySequence.Save),
triggered=self.save)
# Save As ...
self.saveAsAct = QAction(self.tr("Save As ..."), self,
iconText=self.tr("Save As"),
shortcut=QKeySequence(QKeySequence.SaveAs),
triggered=self.saveAs)
# Quit
self.quitAct = QAction(self.tr("Quit"), self,
menuRole=QAction.QuitRole,
shortcut=QKeySequence(QKeySequence.Quit),
triggered=self.close)
# Preferences ...
self.preferencesAct = QAction(self.tr("Preferences ..."), self,
menuRole=QAction.PreferencesRole,
shortcut=QKeySequence(QKeySequence.Preferences),
triggered=self.preferencePane.show)
# Zoom Default
self.zoomDefAct = QAction(self.tr("Zoom Default"), self,
shortcut=QKeySequence(Qt.ControlModifier|Qt.Key_Equal),
triggered=self.zoomDef)
# Zoom In
self.zoomInAct = QAction(self.tr("Zoom In"), self,
shortcut=QKeySequence(QKeySequence.ZoomIn),