summaryrefslogtreecommitdiffstats
path: root/tests/manual/scenegraph_lancelot/data/text/text_table_vertically_aligned_image.qml
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2019-07-30 14:14:50 +0200
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2019-07-30 17:30:57 +0200
commitdfc6dc1d94a729f701172861a196b4b34bcd7518 (patch)
tree4868f263c0322e40000c75d8d90df90755f368eb /tests/manual/scenegraph_lancelot/data/text/text_table_vertically_aligned_image.qml
parent0944ff26223bd2c809025c9f42bc9935213f0d43 (diff)
Fix possible crash with top/bottom aligned images
An image inside at the end of a text block which did not start at text position 0 would resolve to an invalid QTextLine, since we passed the document position to lineForTextPosition(), which expects the relative block position. If the image was aligned to top or bottom, so that the extracted QTextLine was actually accessed, this would cause a crash. [ChangeLog][QtQuick][Text] Fixed a bug where aligning an image to "top" or "bottom" could cause a crash under certain circumstances. Task-number: QTBUG-77217 Change-Id: Iaa239ba482f2a765703656e4116cbebb8435a66e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'tests/manual/scenegraph_lancelot/data/text/text_table_vertically_aligned_image.qml')
-rw-r--r--tests/manual/scenegraph_lancelot/data/text/text_table_vertically_aligned_image.qml14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/manual/scenegraph_lancelot/data/text/text_table_vertically_aligned_image.qml b/tests/manual/scenegraph_lancelot/data/text/text_table_vertically_aligned_image.qml
new file mode 100644
index 0000000000..d712f94572
--- /dev/null
+++ b/tests/manual/scenegraph_lancelot/data/text/text_table_vertically_aligned_image.qml
@@ -0,0 +1,14 @@
+import QtQuick 2.0
+
+Item {
+ width: 320
+ height: 480
+
+ Text {
+ anchors.centerIn: parent
+ font.family: "Arial"
+ font.pixelSize: 16
+ textFormat: Text.RichText
+ text: "<table><tr><td/><td valign=\"top\"><img src=\"data/logo.png\"></td></tr></table>"
+ }
+}