aboutsummaryrefslogtreecommitdiffstats
path: root/tests/manual
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>2015-04-08 13:09:24 +0200
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>2015-04-09 06:32:08 +0000
commit067a01bc76b76599aa696d867018c1e060ff30c6 (patch)
tree26da8e12431d26d74e40f288a5eaf38a9761ec25 /tests/manual
parent0f15c9a4171cd7d07cf290cda6a11f93bbf7b866 (diff)
Fix TextEdit when vertical alignment != AlignTop
When the TextEdit's alignment was either AlignBottom or AlignVCenter, several things would be broken: First of all the position of all non-dirty nodes would not be updated, so if you e.g. added text to the end of the document, it would overlap with the previously added text. Also, the frame decorations were always aligned to the top, since the basePosition was not accounted for in the node for this. The fix is to translate the root node to the base position instead of baking this into the position of the text nodes. This also automatically fixes frame decorations since it's already aligned to the top of the root node. [ChangeLog][TextEdit] Fixed issues with using other vertical alignments than AlignTop. Change-Id: I11f73eab21a28658a5cbf00292fd519efd0f3e7f Task-number: QTBUG-45032 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Diffstat (limited to 'tests/manual')
-rw-r--r--tests/manual/scenegraph_lancelot/data/text/textedit_table.qml21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/manual/scenegraph_lancelot/data/text/textedit_table.qml b/tests/manual/scenegraph_lancelot/data/text/textedit_table.qml
new file mode 100644
index 0000000000..b16472eca6
--- /dev/null
+++ b/tests/manual/scenegraph_lancelot/data/text/textedit_table.qml
@@ -0,0 +1,21 @@
+import QtQuick 2.0
+
+Item {
+ width: 320
+ height: 480
+
+ TextEdit {
+ anchors.fill: parent
+ verticalAlignment: Text.AlignBottom
+ font.family: "Arial"
+ font.pixelSize: 16
+ textFormat: Text.RichText
+ text: "A table: <table border=2>"
+ + "<tr><th>Header 1</th><th>Header 2</th></tr>"
+ + "<tr><td>Cell 1</td><td>Cell 2</td></tr>"
+ + "<tr><td>Cell 3</td><td>Cell 4</td></tr>"
+ + "<tr><td colspan=2>Cell 5</td></tr>"
+ + "<tr><td rowspan=2>Cell 6</td><td>Cell 7</tr>"
+ + "<tr><td>Cell 8</td></tr>"
+ }
+}