summaryrefslogtreecommitdiffstats
path: root/src/gui/text
diff options
context:
space:
mode:
authorAndrew den Exter <andrew.den-exter@nokia.com>2011-05-13 13:49:20 +1000
committerQt Continuous Integration System <qt-info@nokia.com>2011-06-01 09:36:15 +0200
commit50b77ef0b05de59c67c0cf82811d22ca02ef91b4 (patch)
tree1574213cb115b11cc1f29ad7b81d12b5a8a632d1 /src/gui/text
parent16bd22b1bce3add1827d6cfa47d2641e5d4c2d71 (diff)
Make TextEdit word selection more natural.
QTextControl will only extend the selection to a word if the cursor is directly over it which prevents the selection being extended if the mouse is dragged up or down a to a shorter line of text making it difficult to select multiple lines of text. Just disable that limitation when the TextEdit word selection is enabled. Change-Id: I3b9d1575c0141db8441197d740de94a90eacc077 Task-number: QTBUG-19230 Reviewed-by: Martin Jones Reviewed-on: http://codereview.qt.nokia.com/292 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
Diffstat (limited to 'src/gui/text')
-rw-r--r--src/gui/text/qtextcontrol.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/text/qtextcontrol.cpp b/src/gui/text/qtextcontrol.cpp
index e1f42a5fb5..aacac0445c 100644
--- a/src/gui/text/qtextcontrol.cpp
+++ b/src/gui/text/qtextcontrol.cpp
@@ -677,7 +677,7 @@ void QTextControlPrivate::extendWordwiseSelection(int suggestedNewPosition, qrea
const qreal wordEndX = line.cursorToX(curs.position() - blockPos) + blockCoordinates.x();
- if (mouseXPosition < wordStartX || mouseXPosition > wordEndX)
+ if (!wordSelectionEnabled && (mouseXPosition < wordStartX || mouseXPosition > wordEndX))
return;
// keep the already selected word even when moving to the left