| 1 |
import QtQuick 2.0 |
| 2 |
|
| 3 |
//test single font with different elide and wrap modes |
| 4 |
|
| 5 |
Item { |
| 6 |
width: 320 |
| 7 |
height: 480 |
| 8 |
Text { |
| 9 |
id: text_0000 |
| 10 |
x: 0 |
| 11 |
y: 0 |
| 12 |
width: 150 |
| 13 |
text: "The quick brown fox jumps over the lazy dog. Elide left" |
| 14 |
font.bold: false |
| 15 |
elide: Text.ElideLeft |
| 16 |
color: "red" |
| 17 |
font.family: "Arial" |
| 18 |
font.pointSize: 24 |
| 19 |
} |
| 20 |
Text { |
| 21 |
id: text_0001 |
| 22 |
anchors.top: text_0000.bottom |
| 23 |
anchors.left: text_0000.left |
| 24 |
width: 150 |
| 25 |
text: "The quick brown fox jumps over the lazy dog. Elide middle" |
| 26 |
font.bold: false |
| 27 |
elide: Text.ElideMiddle |
| 28 |
color: "blue" |
| 29 |
font.family: "Arial" |
| 30 |
font.pointSize: 24 |
| 31 |
} |
| 32 |
Text { |
| 33 |
id: text_0002 |
| 34 |
width: 150 |
| 35 |
anchors.top: text_0001.bottom |
| 36 |
anchors.left: text_0001.left |
| 37 |
text: "The quick brown fox jumps over the lazy dog. Elide right" |
| 38 |
font.bold: false |
| 39 |
elide: Text.ElideRight |
| 40 |
color: "yellow" |
| 41 |
font.family: "Arial" |
| 42 |
font.pointSize: 24 |
| 43 |
} |
| 44 |
Text { |
| 45 |
id: text_0003 |
| 46 |
width: 150 |
| 47 |
anchors.top: text_0002.bottom |
| 48 |
anchors.left: text_0002.left |
| 49 |
text: "The quick brown fox jumps over the lazy dog. Elide none" |
| 50 |
font.bold: false |
| 51 |
elide: Text.ElideNone |
| 52 |
color: "black" |
| 53 |
font.family: "Arial" |
| 54 |
font.pointSize: 24 |
| 55 |
} |
| 56 |
Text { |
| 57 |
id: text_0004 |
| 58 |
width: 150 |
| 59 |
anchors.top: text_0003.bottom |
| 60 |
anchors.left: text_0003.left |
| 61 |
text: "The quick brown fox jumps over the lazy dog. wrapMode: NoWrap" |
| 62 |
font.bold: false |
| 63 |
wrapMode: Text.NoWrap |
| 64 |
color: "green" |
| 65 |
font.family: "Arial" |
| 66 |
font.pointSize: 24 |
| 67 |
} |
| 68 |
Text { |
| 69 |
id: text_0005 |
| 70 |
width: 150 |
| 71 |
anchors.top: text_0004.bottom |
| 72 |
anchors.left: text_0004.left |
| 73 |
text: "The quick brown fox jumps over the lazy dog. wrapMode: WordWrap " |
| 74 |
font.bold: false |
| 75 |
wrapMode: Text.WordWrap |
| 76 |
color: "light grey" |
| 77 |
font.family: "Arial" |
| 78 |
font.pointSize: 12 |
| 79 |
} |
| 80 |
Text { |
| 81 |
id: text_0006 |
| 82 |
width: 150 |
| 83 |
anchors.top: text_0005.bottom |
| 84 |
anchors.left: text_0005.left |
| 85 |
text: "The quick brown fox jumps over the lazy dog. wrapMode: wrapAnywhere " |
| 86 |
font.bold: false |
| 87 |
wrapMode: Text.WrapAnywhere |
| 88 |
color: "black" |
| 89 |
font.family: "Arial" |
| 90 |
font.pointSize: 12 |
| 91 |
} |
| 92 |
Text { |
| 93 |
id: text_0007 |
| 94 |
width: 150 |
| 95 |
anchors.top: text_0006.bottom |
| 96 |
anchors.left: text_0006.left |
| 97 |
text: "The quick brown fox jumps over the lazy dog. wrapMode: wrap " |
| 98 |
font.bold: false |
| 99 |
wrapMode: Text.Wrap |
| 100 |
color: "light green" |
| 101 |
font.family: "Arial" |
| 102 |
font.pointSize: 12 |
| 103 |
} |
| 104 |
} |