diff options
author | Christian Strømme <christian.stromme@digia.com> | 2014-02-17 15:48:31 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-21 20:33:10 +0100 |
commit | de5ae6917c819ff23f7d9c5742b50b15e0824877 (patch) | |
tree | 5051551731e786aa94413115b1f0792dbe81ea9c /src/widgets/widgets/qlineedit_p.cpp | |
parent | a03a69efb9ed89cd4a90878eda203df62a1c95d9 (diff) |
Android: Enable text selection only when ImhNoPredictiveText is set.
Mouse selection does not work well with Android and text will be
randomly copied, pasted or deleted. This behavior is especially bad
when predictive text is enabled.
Task-number: QTBUG-34616
Change-Id: I732ad7db52169bfb5735c237cf24597a3d6d64ba
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Diffstat (limited to 'src/widgets/widgets/qlineedit_p.cpp')
-rw-r--r-- | src/widgets/widgets/qlineedit_p.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/widgets/widgets/qlineedit_p.cpp b/src/widgets/widgets/qlineedit_p.cpp index 891839ed56..9ff77c87de 100644 --- a/src/widgets/widgets/qlineedit_p.cpp +++ b/src/widgets/widgets/qlineedit_p.cpp @@ -95,7 +95,12 @@ void QLineEditPrivate::_q_completionHighlighted(QString newText) QString text = control->text(); q->setText(text.left(c) + newText.mid(c)); control->moveCursor(control->end(), false); - control->moveCursor(c, true); +#ifndef Q_OS_ANDROID + const bool mark = true; +#else + const bool mark = (imHints & Qt::ImhNoPredictiveText); +#endif + control->moveCursor(c, mark); } } |