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


Python WidgetUtils.addAction方法代码示例

本文整理汇总了Python中peacock.utils.WidgetUtils.addAction方法的典型用法代码示例。如果您正苦于以下问题:Python WidgetUtils.addAction方法的具体用法?Python WidgetUtils.addAction怎么用?Python WidgetUtils.addAction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在peacock.utils.WidgetUtils的用法示例。


在下文中一共展示了WidgetUtils.addAction方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _addMenus

# 需要导入模块: from peacock.utils import WidgetUtils [as 别名]
# 或者: from peacock.utils.WidgetUtils import addAction [as 别名]
 def _addMenus(self):
     """
     Internal method to allow plugins to add menus to the main menu bar.
     """
     super(PeacockMainWindow, self)._addMenus()
     menubar = self.menuBar()
     debug_menu = menubar.addMenu("Debug")
     WidgetUtils.addAction(debug_menu, "Show Python Console", self._showConsole, "Ctrl+P", True)
开发者ID:FHilty,项目名称:moose,代码行数:10,代码来源:PeacockMainWindow.py

示例2: addToMenu

# 需要导入模块: from peacock.utils import WidgetUtils [as 别名]
# 或者: from peacock.utils.WidgetUtils import addAction [as 别名]
    def addToMenu(self, menu):
        """
        Adds menu entries specific to the Arguments to the menubar.
        """
        workingMenu = menu.addMenu("Recent &working dirs")
        self._recent_working_menu = RecentlyUsedMenu(workingMenu,
                "execute/recentWorkingDirs",
                "execute/maxRecentWorkingDirs",
                20,
                )
        self._recent_working_menu.selected.connect(self.setWorkingDir)
        self._workingDirChanged()

        exeMenu = menu.addMenu("Recent &executables")
        self._recent_exe_menu = RecentlyUsedMenu(exeMenu,
                "execute/recentExes",
                "execute/maxRecentExes",
                20,
                )
        self._recent_exe_menu.selected.connect(self.setExecutablePath)

        argsMenu = menu.addMenu("Recent &arguments")
        self._recent_args_menu = RecentlyUsedMenu(argsMenu,
                "execute/recentArgs",
                "execute/maxRecentArgs",
                20,
                )
        self._recent_args_menu.selected.connect(self._setExecutableArgs)
        self._force_reload_action = WidgetUtils.addAction(menu, "Reload executable syntax", self._reload_syntax)
        self._force_reload_action.setEnabled(False)
开发者ID:FHilty,项目名称:moose,代码行数:32,代码来源:ExecuteOptionsPlugin.py

示例3: _addMenus

# 需要导入模块: from peacock.utils import WidgetUtils [as 别名]
# 或者: from peacock.utils.WidgetUtils import addAction [as 别名]
 def _addMenus(self):
     """
     Internal method to allow plugins to add menus to the main menu bar.
     """
     menubar = self.menuBar()
     menubar.setNativeMenuBar(False)
     peacock_menu = menubar.addMenu("Peacock")
     WidgetUtils.addAction(peacock_menu, "View Log", self._showLog, "Ctrl+L", True)
     WidgetUtils.addAction(peacock_menu, "Preferences", self._showPreferences)
     WidgetUtils.addAction(peacock_menu, "E&xit", self.close, "Ctrl+Q", True)
     for name, plugin in self.tab_plugin._plugins.items():
         plugin.addToMainMenu(menubar)
开发者ID:aeslaughter,项目名称:moose,代码行数:14,代码来源:BasePeacockMainWindow.py

示例4: addToMenu

# 需要导入模块: from peacock.utils import WidgetUtils [as 别名]
# 或者: from peacock.utils.WidgetUtils import addAction [as 别名]
    def addToMenu(self, menu):
        """
        Register the menus specific to the InputTab.
        Input:
            menu[QMenu]: The menu to add the items to.
        """
        self._open_action = WidgetUtils.addAction(menu, "Open", self._openInputFile, "Ctrl+O")
        recentMenu = menu.addMenu("Recently opened")
        self._recently_used_menu = RecentlyUsedMenu(recentMenu,
                "input/recentlyUsed",
                "input/maxRecentlyUsed",
                20,
                )
        self._recently_used_menu.selected.connect(self.setInputFile)

        self._save_action = WidgetUtils.addAction(menu, "Save", self._saveInputFile)
        self._save_as_action = WidgetUtils.addAction(menu, "Save As", self._saveInputFileAs)
        self._clear_action = WidgetUtils.addAction(menu, "Clear", self._clearInputFile)
        self._check_action = WidgetUtils.addAction(menu, "Check", self._checkInputFile, "Ctrl+K")
        self._view_file = WidgetUtils.addAction(menu, "View current input file", self._viewInputFile, "Ctrl+V", True)
        self._menus_initialized = True
        self._setMenuStatus()
开发者ID:FHilty,项目名称:moose,代码行数:24,代码来源:InputFileEditorPlugin.py


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