def get_format(self):
format = QtGui.QTextCharFormat()<EOL>qcolor = self.get_color(self.foreground_color, self.intensity)<EOL>if qcolor is not None:<EOL><INDENT>format.setForeground(qcolor)<EOL><DEDENT>qcolor = self.get_color(self.background_color, self.intensity)<EOL>if qcolor is not None:<EOL><INDENT>format.setBackground(qcolor)<EOL><DEDENT>if self.bold:<EOL><INDENT>format.setFontWeight(QtGui.QFont.Bold)<EOL><DEDENT>else:<EOL><INDENT>format.setFontWeight(QtGui.QFont.Normal)<EOL><DEDENT>format.setFontItalic(self.italic)<EOL>format.setFontUnderline(self.underline)<EOL>return format<EOL>
Returns a QTextCharFormat that encodes the current style attributes.