From 83cb2069ead120e7777a13ef6b7c0a0b14052685 Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Sun, 28 Feb 2016 22:43:42 +0100 Subject: 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 --- tests/auto/quick/qquicktextedit/data/qtbug51115.qml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 tests/auto/quick/qquicktextedit/data/qtbug51115.qml (limited to 'tests/auto/quick/qquicktextedit/data') diff --git a/tests/auto/quick/qquicktextedit/data/qtbug51115.qml b/tests/auto/quick/qquicktextedit/data/qtbug51115.qml new file mode 100644 index 0000000000..e3179cfc8e --- /dev/null +++ b/tests/auto/quick/qquicktextedit/data/qtbug51115.qml @@ -0,0 +1,11 @@ +import QtQuick 2.0 + +TextEdit { + Component.onCompleted: { + readOnly = false; + text= "bla bla"; + selectAll(); + readOnly = true; + } +} + -- cgit v1.2.3