forked from qt-creator/qt-creator
Bookmark: Store line text trimmed
Change-Id: I6f96210db20a8d18b5ceb5f6a3b529ea8d2bc0c5 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
@@ -79,8 +79,9 @@ void Bookmark::move(int line)
|
||||
|
||||
void Bookmark::updateBlock(const QTextBlock &block)
|
||||
{
|
||||
if (m_lineText != block.text()) {
|
||||
m_lineText = block.text();
|
||||
const QString &lineText = block.text().trimmed();
|
||||
if (m_lineText != lineText) {
|
||||
m_lineText = lineText;
|
||||
m_manager->updateBookmark(this);
|
||||
}
|
||||
}
|
||||
|
@@ -198,7 +198,7 @@ void BookmarkDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opti
|
||||
|
||||
QString lineText = index.data(BookmarkManager::Note).toString().trimmed();
|
||||
if (lineText.isEmpty())
|
||||
lineText = index.data(BookmarkManager::LineText).toString().trimmed();
|
||||
lineText = index.data(BookmarkManager::LineText).toString();
|
||||
|
||||
painter->drawText(6, opt.rect.top() + fm.ascent() + fm.height() + 6, lineText);
|
||||
|
||||
|
Reference in New Issue
Block a user