| 1 |
import QtQuick 2.0 |
| 2 |
|
| 3 |
//test wrapping and elision when maximumLineCount is set |
| 4 |
|
| 5 |
Item { |
| 6 |
width: 320 |
| 7 |
height: 480 |
| 8 |
Rectangle { |
| 9 |
id: text_area |
| 10 |
color: "light yellow" |
| 11 |
x: 50 |
| 12 |
y: 0 |
| 13 |
height: parent.height |
| 14 |
width: 150 |
| 15 |
} |
| 16 |
Text { |
| 17 |
id: text_0000 |
| 18 |
wrapMode: Text.WrapAnywhere |
| 19 |
text: "The quick brown fox jumps over the lazy dog." |
| 20 |
x: text_area.x |
| 21 |
y: text_area.y |
| 22 |
width: text_area.width |
| 23 |
maximumLineCount: 2 |
| 24 |
elide: Text.ElideRight |
| 25 |
color: "red" |
| 26 |
font.family: "Arial" |
| 27 |
font.pixelSize: 22 |
| 28 |
} |
| 29 |
Text { |
| 30 |
id: text_0001 |
| 31 |
wrapMode: Text.Wrap |
| 32 |
text: text_0000.text |
| 33 |
anchors.top: text_0000.bottom |
| 34 |
anchors.left: text_0000.left |
| 35 |
width: text_0000.width |
| 36 |
maximumLineCount: text_0000.maximumLineCount |
| 37 |
elide: Text.ElideRight |
| 38 |
color: "blue" |
| 39 |
font.family: text_0000.font.family |
| 40 |
font.pixelSize: text_0000.font.pixelSize |
| 41 |
} |
| 42 |
Text { |
| 43 |
id: text_0002 |
| 44 |
wrapMode: Text.WordWrap |
| 45 |
text: text_0000.text |
| 46 |
anchors.top: text_0001.bottom |
| 47 |
anchors.left: text_0000.left |
| 48 |
width: text_0000.width |
| 49 |
maximumLineCount: text_0000.maximumLineCount |
| 50 |
elide: Text.ElideRight |
| 51 |
color: "green" |
| 52 |
font.family: text_0000.font.family |
| 53 |
font.pixelSize: text_0000.font.pixelSize |
| 54 |
} |
| 55 |
Text { |
| 56 |
id: text_0003 |
| 57 |
wrapMode: Text.WrapAnywhere |
| 58 |
text: "ABCDEFGHIJKL 1234567890123" |
| 59 |
anchors.top: text_0002.bottom |
| 60 |
anchors.left: text_0000.left |
| 61 |
width: 150 |
| 62 |
maximumLineCount: 2 |
| 63 |
elide: Text.ElideRight |
| 64 |
color: "red" |
| 65 |
font.family: text_0000.font.family |
| 66 |
font.pixelSize: text_0000.font.pixelSize |
| 67 |
} |
| 68 |
Text { |
| 69 |
id: text_0004 |
| 70 |
wrapMode: Text.Wrap |
| 71 |
text: text_0003.text |
| 72 |
anchors.top: text_0003.bottom |
| 73 |
anchors.left: text_0000.left |
| 74 |
width: text_0000.width |
| 75 |
maximumLineCount: text_0000.maximumLineCount |
| 76 |
elide: Text.ElideRight |
| 77 |
color: "blue" |
| 78 |
font.family: text_0000.font.family |
| 79 |
font.pixelSize: text_0000.font.pixelSize |
| 80 |
} |
| 81 |
Text { |
| 82 |
id: text_0005 |
| 83 |
wrapMode: Text.WordWrap |
| 84 |
text: text_0003.text |
| 85 |
anchors.top: text_0004.bottom |
| 86 |
anchors.left: text_0000.left |
| 87 |
width: text_0000.width |
| 88 |
maximumLineCount: text_0000.maximumLineCount |
| 89 |
elide: Text.ElideRight |
| 90 |
color: "green" |
| 91 |
font.family: text_0000.font.family |
| 92 |
font.pixelSize: text_0000.font.pixelSize |
| 93 |
} |
| 94 |
Text { |
| 95 |
id: text_0006 |
| 96 |
wrapMode: Text.WrapAnywhere |
| 97 |
text: "The quick brown 1234567890123" |
| 98 |
anchors.top: text_0005.bottom |
| 99 |
anchors.left: text_0000.left |
| 100 |
width: 150 |
| 101 |
maximumLineCount: 2 |
| 102 |
elide: Text.ElideRight |
| 103 |
color: "red" |
| 104 |
font.family: text_0000.font.family |
| 105 |
font.pixelSize: text_0000.font.pixelSize |
| 106 |
} |
| 107 |
Text { |
| 108 |
id: text_0007 |
| 109 |
wrapMode: Text.Wrap |
| 110 |
text: text_0006.text |
| 111 |
anchors.top: text_0006.bottom |
| 112 |
anchors.left: text_0000.left |
| 113 |
width: text_0000.width |
| 114 |
maximumLineCount: text_0000.maximumLineCount |
| 115 |
elide: Text.ElideRight |
| 116 |
color: "blue" |
| 117 |
font.family: text_0000.font.family |
| 118 |
font.pixelSize: text_0000.font.pixelSize |
| 119 |
} |
| 120 |
Text { |
| 121 |
id: text_0008 |
| 122 |
wrapMode: Text.WordWrap |
| 123 |
text: text_0006.text |
| 124 |
anchors.top: text_0007.bottom |
| 125 |
anchors.left: text_0000.left |
| 126 |
width: text_0000.width |
| 127 |
maximumLineCount: text_0000.maximumLineCount |
| 128 |
elide: Text.ElideRight |
| 129 |
color: "green" |
| 130 |
font.family: text_0000.font.family |
| 131 |
font.pixelSize: text_0000.font.pixelSize |
| 132 |
} |
| 133 |
} |