- fix: hits in the search view not correctly displayed (overlapped with others)

This commit is contained in:
Roy Qu 2022-03-17 15:09:48 +08:00
parent 5d6bf0dbb5
commit 8cbcbb4b98
2 changed files with 2 additions and 0 deletions

View File

@ -34,6 +34,7 @@ Red Panda C++ Version 1.0.0
- fix: if there is a Red Panda C++ process running program, other Red Panda C++ processes can't run program correctly. - fix: if there is a Red Panda C++ process running program, other Red Panda C++ processes can't run program correctly.
- enhancement: ctrl+enter insert a new line at the end of current line - enhancement: ctrl+enter insert a new line at the end of current line
- enhancement: create file in files view - enhancement: create file in files view
- fix: hits in the search view not correctly displayed (overlapped with others)
Red Panda C++ Version 0.14.5 Red Panda C++ Version 0.14.5
- fix: the "gnu c++ 20" option in compiler set options is wrong - fix: the "gnu c++ 20" option in compiler set options is wrong

View File

@ -460,6 +460,7 @@ void SearchResultTreeViewDelegate::paint(QPainter *painter, const QStyleOptionVi
QFont font = option.font; QFont font = option.font;
font.setBold(true); font.setBold(true);
text=item->text.mid(item->start-1,item->len); text=item->text.mid(item->start-1,item->len);
metrics = QFontMetrics(font);
int width = metrics.horizontalAdvance(text); int width = metrics.horizontalAdvance(text);
QFont oldFont = painter->font(); QFont oldFont = painter->font();
QPen oldPen = painter->pen(); QPen oldPen = painter->pen();