def textCharFormat_spell_builder(self): format = QtGui.QTextCharFormat() format.setFontUnderline(True) format.setUnderlineColor(QtCore.Qt.red) format.setUnderlineStyle(QtGui.QTextCharFormat.SpellCheckUnderline) format.setBackground(QtCore.Qt.transparent) return format
def highlightFormat(self, scope): if self.theme is None: return None if scope not in PMXSyntaxHighlighter.FORMAT_CACHE: format = QtGui.QTextCharFormat() settings = self.theme.getStyle(scope) if 'foreground' in settings: format.setForeground(settings['foreground']) if 'background' in settings: format.setBackground(settings['background']) if 'fontStyle' in settings: if 'bold' in settings['fontStyle']: format.setFontWeight(QtGui.QFont.Bold) if 'underline' in settings['fontStyle']: format.setFontUnderline(True) if 'italic' in settings['fontStyle']: format.setFontItalic(True) PMXSyntaxHighlighter.FORMAT_CACHE[scope] = format return PMXSyntaxHighlighter.FORMAT_CACHE[scope]
def textCharFormat_extraSelection_builder(self): format = QtGui.QTextCharFormat() color = QtGui.QColor(self.editor.colours['selection']) color.setAlpha(128) format.setBackground(color) return format
def defaultTextCharFormatBuilder(self, scope): return QtGui.QTextCharFormat()