Debian Codegraph @

tests/manual/scenegraph_lancelot/data/text/text_advance_multiparagraph.qml

raw
1 import QtQuick 2.10
2
3 Item {
4 width: 320
5 height: 480
6
7 property string firstWord: "<p>One,</p><p>Two, "
8 property string secondWord: "Three</p>"
9
10 Text {
11 id: referenceText
12 text: firstWord + secondWord
13 anchors.centerIn: parent
14 font.italic: true
15 font.pixelSize: 30
16 textFormat: Text.RichText
17 }
18
19
20 Text {
21 id: firstWordItemRichText
22 anchors.left: referenceText.left
23 anchors.top: referenceText.bottom
24 text: firstWord
25 font: referenceText.font
26 textFormat: Text.RichText
27 }
28
29 Text {
30 id: secondWordItemRichText
31 anchors.left: firstWordItemRichText.left
32 anchors.leftMargin: firstWordItemRichText.advance.width
33 anchors.baseline: firstWordItemRichText.baseline
34 anchors.baselineOffset: firstWordItemRichText.advance.height
35 text: secondWord
36 font: referenceText.font
37 textFormat: Text.RichText
38 }
39 }