aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>2015-07-29 13:47:45 +0200
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>2015-08-03 07:18:44 +0000
commitc318fceaccb1ee23a567f1bb032df45417217e09 (patch)
tree46dfad87483c93955e6da40df162d880432177ff /tests
parentf446a79410b81067c982dc48563e2acccded1247 (diff)
Fix disappearing selection spanning different scripts
Due to the way itemization is currently done in Qt, Cyrillic text (and other writing systems) separated by spaces will become separate items because the spaces are itemized as Script_Common. In the Scenegraph's text node engine, we should merge these items into a single node as long as the same font is used for all the text. But a bug in the engine caused this to fail when the text was selected. The symptom of this was that in some rare cases one of the items would vanish if it were in the middle of a selection. In order to support the bearing of selected text leaning outside the selection rect, I previously added a hack which would add all selected text as unselected text as well in b0783c21fb54b939f07ddf5658cc51113b8014e6. This was an awkward way of doing it and caused said regression. A less intrusive way is just to add the text to the scene graph twice, as this does not interfere with the logic needed to support selecting part of ligatures nor the engine's ability to merge nodes correctly. [ChangeLog][Text] Fixed regression with selections spanning different scripts. Task-number: QTBUG-46829 Change-Id: I0faed76fb2cd1ac0b2e5cc54b81008b5e2550733 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/manual/scenegraph_lancelot/data/text/textedit_cyrillic_selected_all.qml13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/manual/scenegraph_lancelot/data/text/textedit_cyrillic_selected_all.qml b/tests/manual/scenegraph_lancelot/data/text/textedit_cyrillic_selected_all.qml
new file mode 100644
index 0000000000..9580f28e29
--- /dev/null
+++ b/tests/manual/scenegraph_lancelot/data/text/textedit_cyrillic_selected_all.qml
@@ -0,0 +1,13 @@
+import QtQuick 2.0
+
+Item {
+ width: 320
+ height: 480
+ TextEdit {
+ id: textEdit
+ text: "и в у"
+ anchors.centerIn: parent
+ Component.onCompleted: textEdit.selectAll()
+ font.pixelSize: 14
+ }
+}