diff options
author | mae <qt-info@nokia.com> | 2009-12-03 19:31:00 (GMT) |
---|---|---|
committer | mae <qt-info@nokia.com> | 2009-12-03 19:31:00 (GMT) |
commit | d1a28d167295958a4404fab37d60ef530c692590 (patch) | |
tree | 76661ab9467290fd021a489c4fe1bfada1d50e15 /src/gui/widgets | |
parent | cf5d234f8d99488a0c3b47b0a7cca0601052a9fa (diff) | |
download | Qt-d1a28d167295958a4404fab37d60ef530c692590.zip Qt-d1a28d167295958a4404fab37d60ef530c692590.tar.gz Qt-d1a28d167295958a4404fab37d60ef530c692590.tar.bz2 |
Fix QPlainTextEdit cursorUp/Down in combination with non-visible blocks
QPlainTextEdit uses QTextCursor::movePosition to reposition the cursor
after pageUp/Down. If this cursor happens to be in non-visual mode
(the default), it might end up on an invisible block. This results
in magically unfolding sections in Qt Creator.
Diffstat (limited to 'src/gui/widgets')
-rw-r--r-- | src/gui/widgets/qplaintextedit.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/gui/widgets/qplaintextedit.cpp b/src/gui/widgets/qplaintextedit.cpp index 89fe7b8..b637c19 100644 --- a/src/gui/widgets/qplaintextedit.cpp +++ b/src/gui/widgets/qplaintextedit.cpp @@ -906,6 +906,7 @@ void QPlainTextEditPrivate::pageUpDown(QTextCursor::MoveOperation op, QTextCurso setTopBlock(block.blockNumber(), line); if (moveCursor) { + cursor.setVisualNavigation(true); // move using movePosition to keep the cursor's x lastY += verticalOffset(); bool moved = false; |