diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-03-14 16:21:32 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-03-14 16:21:32 (GMT) |
commit | 659351bc2e49637a14359dccdafc3ed03b46e645 (patch) | |
tree | 12f3a3ef6be31079a92776994334de258b549bc2 /src/gui/text | |
parent | 5662cda2d836f448d036ed516d0b9a2795f6905c (diff) | |
parent | 71c84f0be1632a6c7b3cee7b55762e656c5a7826 (diff) | |
download | Qt-659351bc2e49637a14359dccdafc3ed03b46e645.zip Qt-659351bc2e49637a14359dccdafc3ed03b46e645.tar.gz Qt-659351bc2e49637a14359dccdafc3ed03b46e645.tar.bz2 |
Merge branch 4.7 into qt-master-from-4.7
Diffstat (limited to 'src/gui/text')
-rw-r--r-- | src/gui/text/qtextcontrol.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/gui/text/qtextcontrol.cpp b/src/gui/text/qtextcontrol.cpp index c847bb5..b7a2697 100644 --- a/src/gui/text/qtextcontrol.cpp +++ b/src/gui/text/qtextcontrol.cpp @@ -1608,7 +1608,10 @@ void QTextControlPrivate::mouseMoveEvent(QEvent *e, Qt::MouseButton button, cons if (!(buttons & Qt::LeftButton)) return; - if (!((interactionFlags & Qt::TextSelectableByMouse) || (interactionFlags & Qt::TextEditable))) + const bool selectable = interactionFlags & Qt::TextSelectableByMouse; + const bool editable = interactionFlags & Qt::TextEditable; + + if (!selectable && !editable) return; if (!(mousePressed @@ -1624,6 +1627,10 @@ void QTextControlPrivate::mouseMoveEvent(QEvent *e, Qt::MouseButton button, cons startDrag(); return; } + + if (!selectable) + return; + const qreal mouseX = qreal(mousePos.x()); int newCursorPos = q->hitTest(mousePos, Qt::FuzzyHit); @@ -1639,7 +1646,7 @@ void QTextControlPrivate::mouseMoveEvent(QEvent *e, Qt::MouseButton button, cons extendBlockwiseSelection(newCursorPos); else if (selectedWordOnDoubleClick.hasSelection()) extendWordwiseSelection(newCursorPos, mouseX); - else if (interactionFlags & Qt::TextSelectableByMouse) + else setCursorPosition(newCursorPos, QTextCursor::KeepAnchor); if (interactionFlags & Qt::TextEditable) { |