summaryrefslogtreecommitdiffstats
path: root/src/gui/text
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2011-03-14 02:24:23 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2011-03-14 02:24:23 (GMT)
commitcf68bbef765b27753b8e81f82b6fc7d7733b12c0 (patch)
tree8cf17c905c25db3c9e6dd598282f93d9fd9e7b0a /src/gui/text
parent7e3efb88e7781294408d94ad703eea60d21ff7be (diff)
parenta1a9929acaeccd7027605ffeb9794b034b146c92 (diff)
downloadQt-cf68bbef765b27753b8e81f82b6fc7d7733b12c0.zip
Qt-cf68bbef765b27753b8e81f82b6fc7d7733b12c0.tar.gz
Qt-cf68bbef765b27753b8e81f82b6fc7d7733b12c0.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-qml: Fix TextEdit mouseSelectionMode overriding selectByMouse.
Diffstat (limited to 'src/gui/text')
-rw-r--r--src/gui/text/qtextcontrol.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/gui/text/qtextcontrol.cpp b/src/gui/text/qtextcontrol.cpp
index f5da079..6babca1 100644
--- a/src/gui/text/qtextcontrol.cpp
+++ b/src/gui/text/qtextcontrol.cpp
@@ -1607,7 +1607,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
@@ -1623,6 +1626,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);
@@ -1638,7 +1645,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) {