forked from qt-creator/qt-creator
Utils: Don't start at end of Markdown document
QTextEdit::show will try to scroll so that the cursor is visible. By default the cursor is at the end of the document after ::setMarkdown(). To counteract we reset the cursor to the top. Change-Id: I0e25878f32775de715fd4789d45274492b2981fe Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -413,6 +413,9 @@ void MarkdownBrowser::setMarkdown(const QString &markdown)
|
||||
{
|
||||
document()->setMarkdown(markdown);
|
||||
postProcessDocument(true);
|
||||
// Reset cursor to start of the document, so that "show" does not
|
||||
// scroll to the end of the document.
|
||||
setTextCursor(QTextCursor(document()));
|
||||
}
|
||||
|
||||
void MarkdownBrowser::postProcessDocument(bool firstTime) const
|
||||
|
Reference in New Issue
Block a user