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


Python TextHelper.selectedText方法代码示例

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


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

示例1: _on_mouse_released

# 需要导入模块: from pyqode.core.api import TextHelper [as 别名]
# 或者: from pyqode.core.api.TextHelper import selectedText [as 别名]
 def _on_mouse_released(self, event):
     """ mouse pressed callback """
     if event.button() == 1 and self._deco:
         cursor = TextHelper(self.editor).word_under_mouse_cursor()
         if cursor and cursor.selectedText():
             self._timer.request_job(
                 self.word_clicked.emit, cursor)
开发者ID:OpenCobolIDE,项目名称:OpenCobolIDE,代码行数:9,代码来源:wordclick.py

示例2: _is_last_chard_end_of_word

# 需要导入模块: from pyqode.core.api import TextHelper [as 别名]
# 或者: from pyqode.core.api.TextHelper import selectedText [as 别名]
 def _is_last_chard_end_of_word(self):
     try:
         tc = TextHelper(self.editor).word_under_cursor()
         tc.setPosition(tc.position())
         tc.movePosition(tc.StartOfLine, tc.KeepAnchor)
         l = tc.selectedText()
         last_char = l[len(l) - 1]
         seps = self.editor.word_separators
         symbols = [",", " ", "("]
         return last_char in seps and last_char not in symbols
     except IndexError:
         return False
开发者ID:abdullahtahiriyo,项目名称:cadquery-freecad-module,代码行数:14,代码来源:calltips.py

示例3: requestGoTo

# 需要导入模块: from pyqode.core.api import TextHelper [as 别名]
# 或者: from pyqode.core.api.TextHelper import selectedText [as 别名]
    def requestGoTo(self, tc=None):
        """
        Request a go to assignment.

        :param tc: Text cursor which contains the text that we must look for
                   its assignment. Can be None to go to the text that is under
                   the text cursor.
        :type tc: QtGui.QTextCursor
        """
        if not tc:
            tc = TextHelper(self.editor).word_under_cursor(
                select_whole_word=True)
        symbol = tc.selectedText()
        analyser = getattr(self.editor, "analyserMode")
        if analyser:
            node = analyser.root_node.find(symbol)
            if node:
                self._definition = node
                QTimer.singleShot(100, self._goToDefinition)
开发者ID:Astalaseven,项目名称:OpenCobolIDE,代码行数:21,代码来源:modes.py


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