diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2014-06-10 11:42:23 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-06-10 14:09:29 +0200 |
commit | e3d32bce79ee81e0434e91b225adaa6c42b5ec3a (patch) | |
tree | 21518f3b94d20af7390b8e355c67d7eec94360a2 | |
parent | 1a3d149174efca50de812c4f336a7ebfe069243c (diff) | |
download | qtbase-e3d32bce79ee81e0434e91b225adaa6c42b5ec3a.tar.gz |
Fix failing qtdeclarativetextedit auto-test
After commit c3baa7c1dc8c29bfe60e8e5c676c606d4f699005 the qtdeclarativetextedit
tests in the qtquick1 module started failing. This was due to commit
852abfca6f4c349dce9b895956922f96d82df579 from 4.8 not being forward-ported from
Qt 4 to Qt 5, hence the comment in c3baa7c1dc8c29bfe60e8e5c676c606d4f699005
about the missing mousePressEvent line. It was intentionally removed and
instead used further down, which is what this patch adds and therefore acts as
forward-port of 852abfca6f4c349dce9b895956922f96d82df579.
Change-Id: I55978c961002382c1f228bf796c469c10686ba9f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
-rw-r--r-- | src/widgets/widgets/qwidgettextcontrol.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/widgets/widgets/qwidgettextcontrol.cpp b/src/widgets/widgets/qwidgettextcontrol.cpp index b34c297f2e..96438a0bdf 100644 --- a/src/widgets/widgets/qwidgettextcontrol.cpp +++ b/src/widgets/widgets/qwidgettextcontrol.cpp @@ -1712,7 +1712,7 @@ void QWidgetTextControlPrivate::mouseMoveEvent(QEvent *e, Qt::MouseButton button if (newCursorPos == -1) return; - if (wordSelectionEnabled && !selectedWordOnDoubleClick.hasSelection()) { + if (mousePressed && wordSelectionEnabled && !selectedWordOnDoubleClick.hasSelection()) { selectedWordOnDoubleClick = cursor; selectedWordOnDoubleClick.select(QTextCursor::WordUnderCursor); } @@ -1721,7 +1721,7 @@ void QWidgetTextControlPrivate::mouseMoveEvent(QEvent *e, Qt::MouseButton button extendBlockwiseSelection(newCursorPos); else if (selectedWordOnDoubleClick.hasSelection()) extendWordwiseSelection(newCursorPos, mouseX); - else if (!isPreediting()) + else if (mousePressed && !isPreediting()) setCursorPosition(newCursorPos, QTextCursor::KeepAnchor); if (interactionFlags & Qt::TextEditable) { |