(self, selections)
Set list of extra selections.
        Selections are list of tuples ``(startAbsolutePosition, length)``.
        Extra selections are reset on any text modification.

        This is reimplemented method of QPlainTextEdit, it has different signature.
        Do not use QPlainTextEdit method
Set list of extra selections.
        Selections are list of tuples ``(startAbsolutePosition, length)``.
        Extra selections are reset on any text modification.
Set list of extra selections . Selections are list of tuples ( startAbsolutePosition length ) . Extra selections are reset on any text modification .
def setExtraSelections(self, selections):
        """Set list of extra selections.
        Selections are list of tuples ``(startAbsolutePosition, length)``.
        Extra selections are reset on any text modification.

        This is reimplemented method of QPlainTextEdit, it has different signature.
        Do not use QPlainTextEdit method
        """

        def _makeQtExtraSelection(startAbsolutePosition, length):
            selection = QTextEdit.ExtraSelection()
            cursor = QTextCursor(self.document())
            cursor.setPosition(startAbsolutePosition)
            cursor.setPosition(startAbsolutePosition + length, QTextCursor.KeepAnchor)
            selection.cursor = cursor
            selection.format = self._userExtraSelectionFormat
            return selection

        self._userExtraSelections = [_makeQtExtraSelection(*item) for item in selections]
        self._updateExtraSelections()
def setExtraSelections ( self , selections ) : def _makeQtExtraSelection ( startAbsolutePosition , length ) : selection = QTextEdit . ExtraSelection ( ) cursor = QTextCursor ( self . document ( ) ) cursor . setPosition ( startAbsolutePosition ) cursor . setPosition ( startAbsolutePosition + length , QTextCursor . KeepAnchor ) selection . cursor = cursor selection . format = self . _userExtraSelectionFormat return selection self . _userExtraSelections = [ _makeQtExtraSelection ( * item ) for item in selections ] self . _updateExtraSelections ( )