6 #ifndef QT4TEXTFORMATTER_H_
7 #define QT4TEXTFORMATTER_H_
9 #include <QTextCharFormat>
10 #include <QSyntaxHighlighter>
12 #include "TextFormatter.h"
14 namespace srchiliteqt {
16 class Qt4SyntaxHighlighter;
49 const QTextCharFormat &getQTextCharFormat()
const {
53 virtual void setQSyntaxHighlighter(QSyntaxHighlighter *qSyntaxHighlighter_);
61 void format(
const std::string &s,
const srchilite::FormatterParams *params);
81 void setBold(
bool b) {
82 textFormat.setFontWeight(b ? QFont::Bold : QFont::Normal);
85 bool isItalic()
const {
89 void setItalic(
bool i) {
93 bool isUnderline()
const {
97 void setUnderline(
bool u) {
101 bool isMonospace()
const {
102 return textFormat.fontFamily() ==
"Monospace";
105 void setMonospace(
bool m) {
115 void setForegroundColor(
const QColor &color);
122 void setBackgroundColor(
const QColor &color);