本文整理汇总了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
示例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)
示例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)