diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-09-09 06:19:06 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-09-09 06:19:06 (GMT) |
commit | 121141af78771be8c2be4778ab0ee64d3d964240 (patch) | |
tree | 18e041ea6e50563e087240d971ea159d8013bc00 /src | |
parent | 3b4400e9a8a4cc1851344b057d4c4f0bcfcc0400 (diff) | |
parent | 852abfca6f4c349dce9b895956922f96d82df579 (diff) | |
download | Qt-121141af78771be8c2be4778ab0ee64d3d964240.zip Qt-121141af78771be8c2be4778ab0ee64d3d964240.tar.gz Qt-121141af78771be8c2be4778ab0ee64d3d964240.tar.bz2 |
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-qml-staging into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/qt-qml-staging:
Fix double click and drag not extending word selection.
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/text/qtextcontrol.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/gui/text/qtextcontrol.cpp b/src/gui/text/qtextcontrol.cpp index bde2c34..aeeef85 100644 --- a/src/gui/text/qtextcontrol.cpp +++ b/src/gui/text/qtextcontrol.cpp @@ -1638,16 +1638,13 @@ void QTextControlPrivate::mouseMoveEvent(QEvent *e, Qt::MouseButton button, cons return; } - if (!mousePressed) - return; - const qreal mouseX = qreal(mousePos.x()); int newCursorPos = q->hitTest(mousePos, Qt::FuzzyHit); if (newCursorPos == -1) return; - if (wordSelectionEnabled && !selectedWordOnDoubleClick.hasSelection()) { + if (mousePressed && wordSelectionEnabled && !selectedWordOnDoubleClick.hasSelection()) { selectedWordOnDoubleClick = cursor; selectedWordOnDoubleClick.select(QTextCursor::WordUnderCursor); } @@ -1656,7 +1653,7 @@ void QTextControlPrivate::mouseMoveEvent(QEvent *e, Qt::MouseButton button, cons extendBlockwiseSelection(newCursorPos); else if (selectedWordOnDoubleClick.hasSelection()) extendWordwiseSelection(newCursorPos, mouseX); - else + else if (mousePressed) setCursorPosition(newCursorPos, QTextCursor::KeepAnchor); if (interactionFlags & Qt::TextEditable) { |