23 QMutexLocker locker(
mutex);
30 uint hash = qHash(text);
31 if(
cache.contains(hash))
37 foreach(form,
cache.value(hash)){
38 for(
int i =0; i < form.
indexes.size();i++)
49 QList<FormatCache> forms;
54 QRegExp expression(rule.
pattern);
55 int index = text.indexOf(expression);
60 length = expression.matchedLength();
63 setFormat(index, length, rule.
format);
64 index = text.indexOf(expression, index + length);
68 cache.insert(hash,forms);
80 QTextCharFormat format;
81 format.setBackground(Qt::yellow);
82 setFormat(index, length, format);