当前位置: 首页>>代码示例>>Python>>正文


Python QAction.setMenu方法代码示例

本文整理汇总了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),
开发者ID:webushka,项目名称:reduce,代码行数:70,代码来源:qrmainwindow.py


注:本文中的PySide.QtGui.QAction.setMenu方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。