forked from qt-creator/qt-creator
Editor: fix select all
Prevent scrolling to the end of the document after triggering select all. Fixes: QTCREATORBUG-26736 Change-Id: I744dddee87ac16ae2399d37483552fc6b535df46 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -7237,9 +7237,10 @@ void TextEditorWidget::cut()
|
|||||||
|
|
||||||
void TextEditorWidget::selectAll()
|
void TextEditorWidget::selectAll()
|
||||||
{
|
{
|
||||||
QTextCursor c = textCursor();
|
QPlainTextEdit::selectAll();
|
||||||
c.select(QTextCursor::Document);
|
// Directly update the internal multi text cursor here to prevent calling setTextCursor.
|
||||||
doSetTextCursor(c);
|
// This would indirectly makes sure the cursor is visible which is not desired for select all.
|
||||||
|
const_cast<MultiTextCursor &>(d->m_cursors).setCursors({QPlainTextEdit::textCursor()});
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextEditorWidget::copy()
|
void TextEditorWidget::copy()
|
||||||
|
|||||||
Reference in New Issue
Block a user