コード例 #1
0
 def _get_prev_char(tc):
     tc2 = QTextCursor(tc)
     tc2.movePosition(QTextCursor.PreviousCharacter, QTextCursor.KeepAnchor)
     char = tc2.selectedText()
     while char == ' ':
         tc2.movePosition(QTextCursor.PreviousCharacter, QTextCursor.KeepAnchor)
         char = tc2.selectedText()
     return char.strip()
コード例 #2
0
ファイル: autoindent.py プロジェクト: zwadar/pyqode.python
 def _get_prev_char(tc):
     tc2 = QTextCursor(tc)
     tc2.movePosition(QTextCursor.PreviousCharacter, QTextCursor.KeepAnchor)
     char = tc2.selectedText()
     while char == ' ':
         tc2.movePosition(tc2.PreviousCharacter, tc2.KeepAnchor)
         char = tc2.selectedText()
     return char.strip()
コード例 #3
0
 def _get_full_line(tc):
     tc2 = QTextCursor(tc)
     tc2.select(QTextCursor.LineUnderCursor)
     full_line = tc2.selectedText()
     return full_line
コード例 #4
0
 def _get_next_char(tc):
     tc2 = QTextCursor(tc)
     tc2.movePosition(QTextCursor.NextCharacter, QTextCursor.KeepAnchor)
     char = tc2.selectedText()
     return char
コード例 #5
0
 def _get_last_word_unstripped(tc):
     tc2 = QTextCursor(tc)
     tc2.movePosition(QTextCursor.Left, tc.KeepAnchor, 1)
     tc2.movePosition(QTextCursor.WordLeft, tc.KeepAnchor)
     return tc2.selectedText()
コード例 #6
0
 def _get_next_char(tc):
     tc2 = QTextCursor(tc)
     tc2.movePosition(QTextCursor.NextCharacter, QTextCursor.KeepAnchor)
     char = tc2.selectedText()
     return char
コード例 #7
0
 def _get_last_word_unstripped(tc):
     tc2 = QTextCursor(tc)
     tc2.movePosition(QTextCursor.Left, tc.KeepAnchor, 1)
     tc2.movePosition(QTextCursor.WordLeft, tc.KeepAnchor)
     return tc2.selectedText()
コード例 #8
0
 def _get_full_line(tc):
     tc2 = QTextCursor(tc)
     tc2.select(QTextCursor.LineUnderCursor)
     full_line = tc2.selectedText()
     return full_line