diff options
author | Andrew den Exter <andrew.den-exter@nokia.com> | 2011-05-13 03:49:20 (GMT) |
---|---|---|
committer | Andrew den Exter <andrew.den-exter@nokia.com> | 2011-05-13 04:11:07 (GMT) |
commit | f69e465e15930ef02dceba7175eed6f3f1df070e (patch) | |
tree | d21c81e738b7215bb0097b93396e8e40aa44f07a /src | |
parent | 88492fcea5d5c8dd6a8e1c2458a6a2b8747e84c7 (diff) | |
download | Qt-f69e465e15930ef02dceba7175eed6f3f1df070e.zip Qt-f69e465e15930ef02dceba7175eed6f3f1df070e.tar.gz Qt-f69e465e15930ef02dceba7175eed6f3f1df070e.tar.bz2 |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/text/qtextcontrol.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/text/qtextcontrol.cpp b/src/gui/text/qtextcontrol.cpp index cf8e313..88e0573 100644 --- a/src/gui/text/qtextcontrol.cpp +++ b/src/gui/text/qtextcontrol.cpp @@ -676,7 +676,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 |