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


Python TextHelper.columnNumber方法代码示例

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


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

示例1: _check_word_cursor

# 需要导入模块: from pyqode.core.api import TextHelper [as 别名]
# 或者: from pyqode.core.api.TextHelper import columnNumber [as 别名]
    def _check_word_cursor(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()

        request_data = {
            'code': self.editor.toPlainText(),
            'line': tc.blockNumber(),
            'column': tc.columnNumber(),
            'path': self.editor.file.path,
            'encoding': self.editor.file.encoding
        }
        try:
            self.editor.backend.send_request(
                workers.goto_assignments, request_data,
                on_receive=self._on_results_available)
        except NotRunning:
            pass
开发者ID:AlexLee,项目名称:cadquery-freecad-module,代码行数:27,代码来源:goto_assignements.py

示例2: _on_action_quick_doc_triggered

# 需要导入模块: from pyqode.core.api import TextHelper [as 别名]
# 或者: from pyqode.core.api.TextHelper import columnNumber [as 别名]
 def _on_action_quick_doc_triggered(self):
     tc = TextHelper(self.editor).word_under_cursor(select_whole_word=True)
     request_data = {
         'code': self.editor.toPlainText(),
         'line': tc.blockNumber(),
         'column': tc.columnNumber(),
         'path': self.editor.file.path,
         'encoding': self.editor.file.encoding
     }
     self.editor.backend.send_request(
         quick_doc, request_data, on_receive=self._on_results_available)
开发者ID:SirmoGames,项目名称:hackedit,代码行数:13,代码来源:quick_doc.py

示例3: request_goto

# 需要导入模块: from pyqode.core.api import TextHelper [as 别名]
# 或者: from pyqode.core.api.TextHelper import columnNumber [as 别名]
    def request_goto(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()
        if not self._pending:
            request_data = {
                'code': self.editor.toPlainText(),
                'line': tc.blockNumber() + 1,
                'column': tc.columnNumber(),
                'path': self.editor.file.path,
                'encoding': self.editor.file.encoding
            }
            self.editor.backend.send_request(
                workers.goto_assignments, request_data,
                on_receive=self._on_results_available)
            self._pending = True
        self.editor.set_mouse_cursor(QtCore.Qt.WaitCursor)
开发者ID:PierreBizouard,项目名称:pyqode.python,代码行数:26,代码来源:goto_assignements.py


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