當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。