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


Python EditorTabWidget.enableToolBarEditor方法代码示例

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


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

示例1: PythonConsoleWidget

# 需要导入模块: from console_editor import EditorTabWidget [as 别名]
# 或者: from console_editor.EditorTabWidget import enableToolBarEditor [as 别名]

#.........这里部分代码省略.........
    def _findPrev(self):
        self.tabEditorWidget.currentWidget().newEditor.findText(True)
        self.tabEditorWidget.currentWidget().newEditor.findNext()

    def _textFindChanged(self):
        if not self.lineEditFind.text().isEmpty():
            self.findNextButton.setEnabled(True)
            self.findPrevButton.setEnabled(True)
        else:
            self.findNextButton.setEnabled(False)
            self.findPrevButton.setEnabled(False)

    def onClickGoToLine(self, item, column):
        linenr = int(item.text(1))
        itemName = str(item.text(0))
        charPos = itemName.find(' ')
        if charPos != -1:
            objName = itemName[0:charPos]
        else:
            objName = itemName
        self.tabEditorWidget.currentWidget().newEditor.goToLine(objName, linenr)

    def sextante(self):
       self.shell.commandConsole('sextante')

    def qtCore(self):
       self.shell.commandConsole('qtCore')

    def qtGui(self):
       self.shell.commandConsole('qtGui')

    def toggleEditor(self, checked):
        self.splitterObj.show() if checked else self.splitterObj.hide()
        self.tabEditorWidget.enableToolBarEditor(checked)

    def toggleObjectListWidget(self, checked):
        self.listClassMethod.show() if checked else self.listClassMethod.hide()

    def findTextEditor(self, checked):
        self.widgetFind.show() if checked else self.widgetFind.hide()

    def pasteEditor(self):
        self.tabEditorWidget.currentWidget().newEditor.paste()

    def cutEditor(self):
        self.tabEditorWidget.currentWidget().newEditor.cut()

    def copyEditor(self):
        self.tabEditorWidget.currentWidget().newEditor.copy()

    def runScriptEditor(self):
        self.tabEditorWidget.currentWidget().newEditor.runScriptCode()

    def commentCode(self):
        self.tabEditorWidget.currentWidget().newEditor.commentEditorCode(True)

    def uncommentCode(self):
        self.tabEditorWidget.currentWidget().newEditor.commentEditorCode(False)

#    def openScriptFile(self):
#       settings = QSettings()
#       lastDirPath = settings.value("pythonConsole/lastDirPath").toString()
#       scriptFile = QFileDialog.getOpenFileName(
#                       self, "Open File", lastDirPath, "Script file (*.py)")
#       if scriptFile.isEmpty() == False:
#           oF = open(scriptFile, 'r')
开发者ID:cyclingzealot,项目名称:Quantum-GIS,代码行数:70,代码来源:console.py

示例2: PythonConsoleWidget

# 需要导入模块: from console_editor import EditorTabWidget [as 别名]
# 或者: from console_editor.EditorTabWidget import enableToolBarEditor [as 别名]

#.........这里部分代码省略.........
        else:
            self.lineEditFind.setStyleSheet('')
            self.findNextButton.setEnabled(False)
            self.findPrevButton.setEnabled(False)

    def onClickGoToLine(self, item, column):
        tabEditor = self.tabEditorWidget.currentWidget().newEditor
        if item.text(1) == 'syntaxError':
            check = tabEditor.syntaxCheck(fromContextMenu=False)
            if check and not tabEditor.isReadOnly():
                self.tabEditorWidget.currentWidget().save()
            return
        linenr = int(item.text(1))
        itemName = str(item.text(0))
        charPos = itemName.find(' ')
        if charPos != -1:
            objName = itemName[0:charPos]
        else:
            objName = itemName
        tabEditor.goToLine(objName, linenr)

    def processing(self):
        self.shell.commandConsole('processing')

    def qtCore(self):
        self.shell.commandConsole('qtCore')

    def qtGui(self):
        self.shell.commandConsole('qtGui')

    def toggleEditor(self, checked):
        self.splitterObj.show() if checked else self.splitterObj.hide()
        if not self.tabEditorWidget:
            self.tabEditorWidget.enableToolBarEditor(checked)
            self.tabEditorWidget.restoreTabsOrAddNew()

    def toggleObjectListWidget(self, checked):
        self.listClassMethod.show() if checked else self.listClassMethod.hide()

    def findTextEditor(self, checked):
        self.widgetFind.show() if checked else self.widgetFind.hide()

    def pasteEditor(self):
        self.tabEditorWidget.currentWidget().newEditor.paste()

    def cutEditor(self):
        self.tabEditorWidget.currentWidget().newEditor.cut()

    def copyEditor(self):
        self.tabEditorWidget.currentWidget().newEditor.copy()

    def runScriptEditor(self):
        self.tabEditorWidget.currentWidget().newEditor.runScriptCode()

    def commentCode(self):
        self.tabEditorWidget.currentWidget().newEditor.commentEditorCode(True)

    def uncommentCode(self):
        self.tabEditorWidget.currentWidget().newEditor.commentEditorCode(False)

    def openScriptFileExtEditor(self):
        tabWidget = self.tabEditorWidget.currentWidget()
        path = tabWidget.path
        import subprocess
        try:
            subprocess.Popen([os.environ['EDITOR'], path])
开发者ID:Geoneer,项目名称:QGIS,代码行数:70,代码来源:console.py


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