aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquicktextedit.cpp
diff options
context:
space:
mode:
authorRobin Burchell <robin.burchell@viroteck.net>2016-02-28 22:43:42 +0100
committerRobin Burchell <robin.burchell@viroteck.net>2016-03-01 21:47:49 +0000
commit83cb2069ead120e7777a13ef6b7c0a0b14052685 (patch)
treeb443c6a18b91967e6f46dc1b29bb53bd01ff8b62 /src/quick/items/qquicktextedit.cpp
parent23712c568072422e49d41f039ad72c92fd117afe (diff)
QQuickText{Edit,Input}: Reset selection when becoming readOnly.
When read only, controls may not be edited or altered, and indeed, a read-only control cannot acquire a selection (as it cannot be interacted with). Leaving an existing selection breaks that implication, so clear it when becoming read-only. [ChangeLog][QtQuick][TextEdit/TextInput] If a control has a selection, it is now cleared when becoming read-only. Task-number: QTBUG-51115 Change-Id: Ife43b97ee3d6b780f09a938868c3ccb2f1b6e6e7 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/quick/items/qquicktextedit.cpp')
-rw-r--r--src/quick/items/qquicktextedit.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/quick/items/qquicktextedit.cpp b/src/quick/items/qquicktextedit.cpp
index f6c3d2f09f..f2e9f63fa9 100644
--- a/src/quick/items/qquicktextedit.cpp
+++ b/src/quick/items/qquicktextedit.cpp
@@ -1534,8 +1534,7 @@ void QQuickTextEdit::setReadOnly(bool r)
if (!r)
flags = flags | Qt::TextEditable;
d->control->setTextInteractionFlags(flags);
- if (!r)
- d->control->moveCursor(QTextCursor::End);
+ d->control->moveCursor(QTextCursor::End);
#ifndef QT_NO_IM
updateInputMethod(Qt::ImEnabled);