58 const QRegularExpression & regex,
const QString & text)
60 QRegularExpressionMatchIterator i = regex.globalMatch(text);
62 QRegularExpressionMatch match = i.next();
63 setFormat(match.capturedStart(0), match.capturedLength(0), format);
82 KConfigGroup cfg(KSharedConfig::openConfig(),
"SvgTextTool");
83 QColor background = cfg.readEntry(
"colorEditorBackground", qApp->palette().window().color());
85 m_xmlKeywordFormat.setForeground(cfg.readEntry(
"colorKeyword", QColor(background.value() < 100 ? Qt::cyan : Qt::blue)));
86 m_xmlKeywordFormat.setFontWeight(cfg.readEntry(
"BoldKeyword",
true) ? QFont::Bold : QFont::Normal);
89 m_xmlElementFormat.setForeground(cfg.readEntry(
"colorElement", QColor(background.value() < 100 ? Qt::magenta : Qt::darkMagenta)));
90 m_xmlElementFormat.setFontWeight(cfg.readEntry(
"BoldElement",
true) ? QFont::Bold : QFont::Normal);
93 m_xmlAttributeFormat.setForeground(cfg.readEntry(
"colorAttribute", QColor(background.value() < 100 ? Qt::green : Qt::darkGreen)));
94 m_xmlAttributeFormat.setFontWeight(cfg.readEntry(
"BoldAttribute",
true) ? QFont::Bold : QFont::Normal);
97 m_xmlValueFormat.setForeground(cfg.readEntry(
"colorValue", QColor(background.value() < 100 ? Qt::red: Qt::darkRed)));
98 m_xmlValueFormat.setFontWeight(cfg.readEntry(
"BoldValue",
true) ? QFont::Bold : QFont::Normal);
101 m_xmlCommentFormat.setForeground(cfg.readEntry(
"colorComment", QColor(background.value() < 100 ? Qt::lightGray : Qt::gray)));
102 m_xmlCommentFormat.setFontWeight(cfg.readEntry(
"BoldComment",
false) ? QFont::Bold : QFont::Normal);