forked from openkylin/ukui-search
增加正则表达式转义,避免偶现的搜索UI卡死现象。
This commit is contained in:
parent
3639b716ef
commit
4755c9a247
|
@ -228,6 +228,7 @@ void ResultItemStyle::drawControl(QStyle::ControlElement element, const QStyleOp
|
|||
HightLightEffectHelper::HightLightEffectHelper(QObject *parent) : QSyntaxHighlighter(parent)
|
||||
{
|
||||
m_expression.setCaseSensitivity(Qt::CaseInsensitive);
|
||||
m_expression.setPatternSyntax(QRegExp::FixedString);
|
||||
}
|
||||
|
||||
void HightLightEffectHelper::setExpression(const QString &text)
|
||||
|
@ -243,7 +244,6 @@ void HightLightEffectHelper::setTextColor(const QBrush &brush)
|
|||
void HightLightEffectHelper::highlightBlock(const QString &text)
|
||||
{
|
||||
setFormat(0, text.length(), m_textCharFormat);
|
||||
|
||||
m_textCharFormat.setFontWeight(QFont::Bold);
|
||||
int index = text.indexOf(m_expression);
|
||||
while(index >= 0){
|
||||
|
|
Loading…
Reference in New Issue