(self)
return cursors
Cursors for rectangular selection.
        1 cursor for every line
Cursors for rectangular selection.
        1 cursor for every line
Cursors for rectangular selection . 1 cursor for every line
def cursors(self):
        """Cursors for rectangular selection.
        1 cursor for every line
        """
        cursors = []
        if self._start is not None:
            startLine, startVisibleCol = self._start
            currentLine, currentCol = self._qpart.cursorPosition
            if abs(startLine - currentLine) > self._MAX_SIZE or \
               abs(startVisibleCol - currentCol) > self._MAX_SIZE:
                # Too big rectangular selection freezes the GUI
                self._qpart.userWarning.emit('Rectangular selection area is too big')
                self._start = None
                return []

            currentBlockText = self._qpart.textCursor().block().text()
            currentVisibleCol = self._realToVisibleColumn(currentBlockText, currentCol)

            for lineNumber in range(min(startLine, currentLine),
                                    max(startLine, currentLine) + 1):
                block = self._qpart.document().findBlockByNumber(lineNumber)
                cursor = QTextCursor(block)
                realStartCol = self._visibleToRealColumn(block.text(), startVisibleCol)
                realCurrentCol = self._visibleToRealColumn(block.text(), currentVisibleCol)
                if realStartCol is None:
                    realStartCol = block.length()  # out of range value
                if realCurrentCol is None:
                    realCurrentCol = block.length()  # out of range value

                cursor.setPosition(cursor.block().position() +
                                   min(realStartCol, block.length() - 1))
                cursor.setPosition(cursor.block().position() +
                                   min(realCurrentCol, block.length() - 1),
                                   QTextCursor.KeepAnchor)
                cursors.append(cursor)

        return cursors
def cursors ( self ) : cursors = [ ] if self . _start is not None : startLine , startVisibleCol = self . _start currentLine , currentCol = self . _qpart . cursorPosition if abs ( startLine - currentLine ) > self . _MAX_SIZE or abs ( startVisibleCol - currentCol ) > self . _MAX_SIZE : # Too big rectangular selection freezes the GUI self . _qpart . userWarning . emit ( 'Rectangular selection area is too big' ) self . _start = None return [ ] currentBlockText = self . _qpart . textCursor ( ) . block ( ) . text ( ) currentVisibleCol = self . _realToVisibleColumn ( currentBlockText , currentCol ) for lineNumber in range ( min ( startLine , currentLine ) , max ( startLine , currentLine ) + 1 ) : block = self . _qpart . document ( ) . findBlockByNumber ( lineNumber ) cursor = QTextCursor ( block ) realStartCol = self . _visibleToRealColumn ( block . text ( ) , startVisibleCol ) realCurrentCol = self . _visibleToRealColumn ( block . text ( ) , currentVisibleCol ) if realStartCol is None : realStartCol = block . length ( ) # out of range value if realCurrentCol is None : realCurrentCol = block . length ( ) # out of range value cursor . setPosition ( cursor . block ( ) . position ( ) + min ( realStartCol , block . length ( ) - 1 ) ) cursor . setPosition ( cursor . block ( ) . position ( ) + min ( realCurrentCol , block . length ( ) - 1 ) , QTextCursor . KeepAnchor ) cursors . append ( cursor ) return cursors