62 const QRegExp & regex,
const QString & text)
64 int index = regex.indexIn(text);
68 int matchedLength = regex.matchedLength();
69 setFormat(index, matchedLength, format);
71 index = regex.indexIn(text, index + matchedLength);
89 KConfigGroup cfg(KSharedConfig::openConfig(),
"SvgTextTool");
90 QColor background = cfg.readEntry(
"colorEditorBackground", qApp->palette().window().color());
92 m_xmlKeywordFormat.setForeground(cfg.readEntry(
"colorKeyword", QColor(background.value() < 100 ? Qt::cyan : Qt::blue)));
93 m_xmlKeywordFormat.setFontWeight(cfg.readEntry(
"BoldKeyword",
true) ? QFont::Bold : QFont::Normal);
96 m_xmlElementFormat.setForeground(cfg.readEntry(
"colorElement", QColor(background.value() < 100 ? Qt::magenta : Qt::darkMagenta)));
97 m_xmlElementFormat.setFontWeight(cfg.readEntry(
"BoldElement",
true) ? QFont::Bold : QFont::Normal);
100 m_xmlAttributeFormat.setForeground(cfg.readEntry(
"colorAttribute", QColor(background.value() < 100 ? Qt::green : Qt::darkGreen)));
101 m_xmlAttributeFormat.setFontWeight(cfg.readEntry(
"BoldAttribute",
true) ? QFont::Bold : QFont::Normal);
104 m_xmlValueFormat.setForeground(cfg.readEntry(
"colorValue", QColor(background.value() < 100 ? Qt::red: Qt::darkRed)));
105 m_xmlValueFormat.setFontWeight(cfg.readEntry(
"BoldValue",
true) ? QFont::Bold : QFont::Normal);
108 m_xmlCommentFormat.setForeground(cfg.readEntry(
"colorComment", QColor(background.value() < 100 ? Qt::lightGray : Qt::gray)));
109 m_xmlCommentFormat.setFontWeight(cfg.readEntry(
"BoldComment",
false) ? QFont::Bold : QFont::Normal);