TextEditor: Add line annotations

Displaying short descriptive text of a TextMark at line end.
Currently implemented for ClangTextMark and BookMark.

Change-Id: Idc6b579bda0382ad94b2e236b715696396b10460
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
David Schulz
2017-06-20 08:28:10 +02:00
parent 4506acbffc
commit 6591a01452
17 changed files with 275 additions and 56 deletions

View File

@@ -845,6 +845,13 @@ void TextDocument::modificationChanged(bool modified)
emit changed();
}
void TextDocument::updateLayout() const
{
auto documentLayout = qobject_cast<TextDocumentLayout*>(d->m_document.documentLayout());
QTC_ASSERT(documentLayout, return);
documentLayout->requestUpdate();
}
TextMarks TextDocument::marks() const
{
return d->m_marksCache;
@@ -953,6 +960,7 @@ void TextDocument::removeMark(TextMark *mark)
removeMarkFromMarksCache(mark);
mark->setBaseTextDocument(0);
updateLayout();
}
void TextDocument::updateMark(TextMark *mark)
@@ -964,9 +972,7 @@ void TextDocument::updateMark(TextMark *mark)
userData->removeMark(mark);
userData->addMark(mark);
}
auto documentLayout = qobject_cast<TextDocumentLayout*>(d->m_document.documentLayout());
QTC_ASSERT(documentLayout, return);
documentLayout->requestUpdate();
updateLayout();
}
void TextDocument::moveMark(TextMark *mark, int previousLine)