summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets/qplaintextedit.cpp
diff options
context:
space:
mode:
authormae <qt-info@nokia.com>2009-12-03 20:31:00 +0100
committermae <qt-info@nokia.com>2009-12-03 20:31:00 +0100
commitd1a28d167295958a4404fab37d60ef530c692590 (patch)
tree76661ab9467290fd021a489c4fe1bfada1d50e15 /src/gui/widgets/qplaintextedit.cpp
parentcf5d234f8d99488a0c3b47b0a7cca0601052a9fa (diff)
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/qplaintextedit.cpp')
-rw-r--r--src/gui/widgets/qplaintextedit.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/gui/widgets/qplaintextedit.cpp b/src/gui/widgets/qplaintextedit.cpp
index 89fe7b80a1..b637c19719 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;