diff options
Diffstat (limited to 'tests/auto/declarative/qmlvisual/qdeclarativetext/font')
36 files changed, 450 insertions, 0 deletions
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/BorderedText.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/BorderedText.qml new file mode 100644 index 0000000000..fe4e2e7025 --- /dev/null +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/BorderedText.qml @@ -0,0 +1,9 @@ +import QtQuick 1.0 +import "../../shared" 1.0 + +TestText { + property color bcolor: "blue" + font.pixelSize: 10 + text: "The quick brown fox\njumps over\nthe lazy dog." + Rectangle { id: border; color: "transparent"; border.color: bcolor; anchors.fill: parent; opacity: 0.2 } +} diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext.0.png Binary files differnew file mode 100644 index 0000000000..cfa61a9a99 --- /dev/null +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext.0.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext.qml new file mode 100644 index 0000000000..fdf23106c4 --- /dev/null +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext.qml @@ -0,0 +1,11 @@ +import Qt.VisualTest 4.7 + +VisualTest { + Frame { + msec: 0 + } + Frame { + msec: 16 + image: "plaintext.0.png" + } +} diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext2.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext2.0.png Binary files differnew file mode 100644 index 0000000000..be676c0fc7 --- /dev/null +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext2.0.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext2.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext2.qml new file mode 100644 index 0000000000..f6cddc43a4 --- /dev/null +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext2.qml @@ -0,0 +1,11 @@ +import Qt.VisualTest 4.7 + +VisualTest { + Frame { + msec: 0 + } + Frame { + msec: 16 + image: "plaintext2.0.png" + } +} diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext3.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext3.0.png Binary files differnew file mode 100644 index 0000000000..df2fe2feeb --- /dev/null +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext3.0.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext3.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext3.qml new file mode 100644 index 0000000000..13f413a1ca --- /dev/null +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext3.qml @@ -0,0 +1,11 @@ +import Qt.VisualTest 4.7 + +VisualTest { + Frame { + msec: 0 + } + Frame { + msec: 16 + image: "plaintext3.0.png" + } +} diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/richtext.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/richtext.0.png Binary files differnew file mode 100644 index 0000000000..76e5b9f80f --- /dev/null +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/richtext.0.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/richtext.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/richtext.qml new file mode 100644 index 0000000000..3da391dc50 --- /dev/null +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/richtext.qml @@ -0,0 +1,11 @@ +import Qt.VisualTest 4.7 + +VisualTest { + Frame { + msec: 0 + } + Frame { + msec: 16 + image: "richtext.0.png" + } +} diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/richtext2.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/richtext2.0.png Binary files differnew file mode 100644 index 0000000000..bb65aded70 --- /dev/null +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/richtext2.0.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/richtext2.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/richtext2.qml new file mode 100644 index 0000000000..afae3f89bc --- /dev/null +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/richtext2.qml @@ -0,0 +1,11 @@ +import Qt.VisualTest 4.7 + +VisualTest { + Frame { + msec: 0 + } + Frame { + msec: 16 + image: "richtext2.0.png" + } +} diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/plaintext.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/plaintext.0.png Binary files differnew file mode 100644 index 0000000000..b4e1d3a153 --- /dev/null +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/plaintext.0.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/plaintext.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/plaintext.qml new file mode 100644 index 0000000000..fdf23106c4 --- /dev/null +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/plaintext.qml @@ -0,0 +1,11 @@ +import Qt.VisualTest 4.7 + +VisualTest { + Frame { + msec: 0 + } + Frame { + msec: 16 + image: "plaintext.0.png" + } +} diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/plaintext2.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/plaintext2.0.png Binary files differnew file mode 100644 index 0000000000..4177b9eb08 --- /dev/null +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/plaintext2.0.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/plaintext2.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/plaintext2.qml new file mode 100644 index 0000000000..f6cddc43a4 --- /dev/null +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/plaintext2.qml @@ -0,0 +1,11 @@ +import Qt.VisualTest 4.7 + +VisualTest { + Frame { + msec: 0 + } + Frame { + msec: 16 + image: "plaintext2.0.png" + } +} diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/plaintext3.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/plaintext3.0.png Binary files differnew file mode 100644 index 0000000000..04e0f5e842 --- /dev/null +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/plaintext3.0.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/plaintext3.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/plaintext3.qml new file mode 100644 index 0000000000..13f413a1ca --- /dev/null +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/plaintext3.qml @@ -0,0 +1,11 @@ +import Qt.VisualTest 4.7 + +VisualTest { + Frame { + msec: 0 + } + Frame { + msec: 16 + image: "plaintext3.0.png" + } +} diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/richtext.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/richtext.0.png Binary files differnew file mode 100644 index 0000000000..36e5d35858 --- /dev/null +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/richtext.0.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/richtext.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/richtext.qml new file mode 100644 index 0000000000..3da391dc50 --- /dev/null +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/richtext.qml @@ -0,0 +1,11 @@ +import Qt.VisualTest 4.7 + +VisualTest { + Frame { + msec: 0 + } + Frame { + msec: 16 + image: "richtext.0.png" + } +} diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/richtext2.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/richtext2.0.png Binary files differnew file mode 100644 index 0000000000..34f8e387b9 --- /dev/null +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/richtext2.0.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/richtext2.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/richtext2.qml new file mode 100644 index 0000000000..afae3f89bc --- /dev/null +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/richtext2.qml @@ -0,0 +1,11 @@ +import Qt.VisualTest 4.7 + +VisualTest { + Frame { + msec: 0 + } + Frame { + msec: 16 + image: "richtext2.0.png" + } +} diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/plaintext.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/plaintext.0.png Binary files differnew file mode 100644 index 0000000000..89195ae7dc --- /dev/null +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/plaintext.0.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/plaintext.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/plaintext.qml new file mode 100644 index 0000000000..fdf23106c4 --- /dev/null +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/plaintext.qml @@ -0,0 +1,11 @@ +import Qt.VisualTest 4.7 + +VisualTest { + Frame { + msec: 0 + } + Frame { + msec: 16 + image: "plaintext.0.png" + } +} diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/plaintext2.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/plaintext2.0.png Binary files differnew file mode 100644 index 0000000000..0574f63fe9 --- /dev/null +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/plaintext2.0.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/plaintext2.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/plaintext2.qml new file mode 100644 index 0000000000..f6cddc43a4 --- /dev/null +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/plaintext2.qml @@ -0,0 +1,11 @@ +import Qt.VisualTest 4.7 + +VisualTest { + Frame { + msec: 0 + } + Frame { + msec: 16 + image: "plaintext2.0.png" + } +} diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/plaintext3.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/plaintext3.0.png Binary files differnew file mode 100644 index 0000000000..0d3c672804 --- /dev/null +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/plaintext3.0.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/plaintext3.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/plaintext3.qml new file mode 100644 index 0000000000..13f413a1ca --- /dev/null +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/plaintext3.qml @@ -0,0 +1,11 @@ +import Qt.VisualTest 4.7 + +VisualTest { + Frame { + msec: 0 + } + Frame { + msec: 16 + image: "plaintext3.0.png" + } +} diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/richtext.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/richtext.0.png Binary files differnew file mode 100644 index 0000000000..6a4872839e --- /dev/null +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/richtext.0.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/richtext.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/richtext.qml new file mode 100644 index 0000000000..3da391dc50 --- /dev/null +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/richtext.qml @@ -0,0 +1,11 @@ +import Qt.VisualTest 4.7 + +VisualTest { + Frame { + msec: 0 + } + Frame { + msec: 16 + image: "richtext.0.png" + } +} diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/richtext2.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/richtext2.0.png Binary files differnew file mode 100644 index 0000000000..34f8e387b9 --- /dev/null +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/richtext2.0.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/richtext2.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/richtext2.qml new file mode 100644 index 0000000000..afae3f89bc --- /dev/null +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/richtext2.qml @@ -0,0 +1,11 @@ +import Qt.VisualTest 4.7 + +VisualTest { + Frame { + msec: 0 + } + Frame { + msec: 16 + image: "richtext2.0.png" + } +} diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/plaintext.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/plaintext.qml new file mode 100644 index 0000000000..64ab65b8ae --- /dev/null +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/plaintext.qml @@ -0,0 +1,101 @@ +import QtQuick 1.0 +import "../../shared" 1.0 + +Rectangle { + id: s; width: 620; height: 360; color: "lightsteelblue" + property string text: "Jackdaws love my big sphinx of quartz." + + Column { + spacing: 8 + TestText { + text: s.text; horizontalAlignment: Text.AlignLeft; width: s.width + } + TestText { + font.pixelSize: 18 + text: s.text; horizontalAlignment: Text.AlignHCenter; verticalAlignment: Text.AlignVCenter; width: s.width; + } + TestText { + font.pixelSize: 24 + text: s.text; horizontalAlignment: Text.AlignRight; verticalAlignment: Text.AlignBottom; width: s.width; + } + Grid{ + columns: 2 + spacing: 4 + TestText { + text: s.text; color: "red"; smooth: true + } + TestText { + text: s.text; font.capitalization: "AllUppercase" + } + TestText { + text: s.text; font.underline: true + } + TestText { + text: s.text; font.overline: true; smooth: true + } + TestText { + text: s.text; font.strikeout: true + } + TestText { + text: s.text; font.underline: true; font.overline: true; font.strikeout: true + } + TestText { + text: s.text; style: Text.Outline; styleColor: "white" + } + TestText { + text: s.text; style: Text.Sunken; styleColor: "gray" + } + TestText { + text: s.text; style: Text.Raised; styleColor: "yellow" + } + TestText { + text: s.text; font.letterSpacing: 2 + } + } + TestText { + text: s.text; font.underline: true; font.letterSpacing: 2; font.capitalization: "AllUppercase"; color: "blue" + } + TestText { + text: s.text; font.overline: true; font.wordSpacing: 25; font.capitalization: "Capitalize"; color: "green" + } + Row{ + height: childrenRect.height + spacing: 4 + TestText { + text: s.text; elide: Text.ElideLeft; width: 200 + } + TestText { + text: s.text; elide: Text.ElideMiddle; width: 200 + } + TestText { + text: s.text; elide: Text.ElideRight; width: 200 + } + } + Row{ + height: childrenRect.height + spacing: 4 + TestText{ + text: s.text; elide: Text.ElideLeft; width: 200; wrapMode: Text.WordWrap + } + TestText { + text: s.text; elide: Text.ElideMiddle; width: 200; wrapMode: Text.WordWrap + } + TestText { + text: s.text; elide: Text.ElideRight; width: 200; wrapMode: Text.WordWrap + } + } + Row{ + height: childrenRect.height + spacing: 4 + TestText { + text: s.text + " thisisaverylongstringwithnospaces"; width: 150; wrapMode: Text.WrapAnywhere + } + TestText { + text: s.text + " thisisaverylongstringwithnospaces"; width: 150; wrapMode: Text.Wrap + } + TestText { +text: s.text; font.pixelSize: 18; style: Text.Outline; styleColor: "white"; wrapMode: Text.WordWrap; width: 200 + } + } + } +} diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/plaintext2.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/plaintext2.qml new file mode 100644 index 0000000000..01de1f0046 --- /dev/null +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/plaintext2.qml @@ -0,0 +1,23 @@ +import QtQuick 1.0 +import "../../shared" 1.0 + +Rectangle { + width: 400; height: 200 + + Row { + spacing: 20 + anchors.centerIn: parent + TestText { + text: "First line\nSecond line"; wrapMode: Text.Wrap + } + TestText { + text: "First line\nSecond line"; width: 70 + } + TestText { + text: "First Second\nThird Fourth"; wrapMode: Text.Wrap; width: 50 + } + TestText { + text: "First line<br>Second line"; textFormat: Text.StyledText + } + } +} diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/plaintext3.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/plaintext3.qml new file mode 100644 index 0000000000..10a2d9ab19 --- /dev/null +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/plaintext3.qml @@ -0,0 +1,62 @@ +import QtQuick 1.0 + +Rectangle { + id: main + width: 620; height: 280 + + + Grid { + x: 4; y: 4 + spacing: 8 + columns: 4 + + Column { + spacing: 4 + BorderedText { } + BorderedText { horizontalAlignment: Text.AlignHCenter } + BorderedText { horizontalAlignment: Text.AlignRight } + } + + Column { + spacing: 4 + BorderedText { wrapMode: Text.Wrap } + BorderedText { horizontalAlignment: Text.AlignHCenter; wrapMode: Text.Wrap } + BorderedText { horizontalAlignment: Text.AlignRight; wrapMode: Text.Wrap } + } + + Column { + spacing: 4 + BorderedText { wrapMode: Text.Wrap; elide: Text.ElideRight } + BorderedText { horizontalAlignment: Text.AlignHCenter; wrapMode: Text.Wrap; elide: Text.ElideRight } + BorderedText { horizontalAlignment: Text.AlignRight; wrapMode: Text.Wrap; elide: Text.ElideRight } + } + + Column { + spacing: 4 + BorderedText { width: 230; wrapMode: Text.Wrap; elide: Text.ElideRight } + BorderedText { width: 230; horizontalAlignment: Text.AlignHCenter; wrapMode: Text.Wrap; elide: Text.ElideRight } + BorderedText { width: 230; horizontalAlignment: Text.AlignRight; wrapMode: Text.Wrap; elide: Text.ElideRight } + } + + Column { + spacing: 4 + BorderedText { width: 120; wrapMode: Text.Wrap; elide: Text.ElideRight } + BorderedText { width: 120; horizontalAlignment: Text.AlignHCenter; wrapMode: Text.Wrap; elide: Text.ElideRight } + BorderedText { width: 120; horizontalAlignment: Text.AlignRight; wrapMode: Text.Wrap; elide: Text.ElideRight } + } + + Column { + spacing: 4 + BorderedText { width: 120; wrapMode: Text.Wrap } + BorderedText { width: 120; horizontalAlignment: Text.AlignHCenter; wrapMode: Text.Wrap } + BorderedText { width: 120; horizontalAlignment: Text.AlignRight; wrapMode: Text.Wrap } + } + + Column { + spacing: 4 + BorderedText { width: 120 } + BorderedText { width: 120; horizontalAlignment: Text.AlignHCenter } + BorderedText { width: 120; horizontalAlignment: Text.AlignRight } + } + } +} diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/richtext.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/richtext.qml new file mode 100644 index 0000000000..a748b686c4 --- /dev/null +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/richtext.qml @@ -0,0 +1,47 @@ +import QtQuick 1.0 +import "../../shared" 1.0 + +Rectangle { + id: s; width: 620; height: 300; color: "lightsteelblue" + property string text: "<b>The</b> <i>quick</i> <u>brown</u> <o>fox</o> <big>jumps</big> <small>over</small> <tt>the</tt> <s>lazy</s> <em>dog</em>." + + Column { + spacing: 6 + TestText { + text: s.text + } + TestText { + text: s.text; font.pixelSize: 18 + } + TestText { + text: s.text; font.pixelSize: 24 + } + TestText { + text: s.text; color: "red"; smooth: true + } + TestText { + text: s.text; font.capitalization: "AllUppercase" + } + TestText { + text: s.text; font.underline: true + } + TestText { + text: s.text; font.overline: true; smooth: true + } + TestText { + text: s.text; font.strikeout: true + } + TestText { + text: s.text; font.underline: true; font.overline: true; font.strikeout: true + } + TestText { + text: s.text; font.letterSpacing: 2 + } + TestText { + text: s.text; font.underline: true; font.letterSpacing: 2; font.capitalization: "AllUppercase"; color: "blue" + } + TestText { + text: s.text; font.overline: true; font.wordSpacing: 25; font.capitalization: "Capitalize"; color: "green" + } + } +} diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/richtext2.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/richtext2.qml new file mode 100644 index 0000000000..f5e85fa00a --- /dev/null +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/richtext2.qml @@ -0,0 +1,43 @@ +import QtQuick 1.0 +import "../../shared" 1.0 + +//This is a continuation of richtext.qml, it was bisected so that it could fit on smaller screens +Rectangle { + id: s; width: 620; height: 300; color: "lightsteelblue" + property string text: "<b>The</b> <i>quick</i> <u>brown</u> <o>fox</o> <big>jumps</big> <small>over</small> <tt>the</tt> <s>lazy</s> <em>dog</em>." + + Column { + spacing: 6 + TestText { + text: s.text; font.pixelSize: 18; style: Text.Outline; styleColor: "white" + } + TestText { + text: s.text; font.pixelSize: 18; style: Text.Sunken; styleColor: "gray" + } + TestText { + text: s.text; font.pixelSize: 18; style: Text.Raised; styleColor: "yellow" + } + TestText { + text: s.text; horizontalAlignment: Text.AlignLeft; width: s.width + } + TestText { + text: s.text; horizontalAlignment: Text.AlignHCenter; verticalAlignment: Text.AlignVCenter; width: s.width; height: 20 + } + TestText { + text: s.text; horizontalAlignment: Text.AlignRight; verticalAlignment: Text.AlignBottom; width: s.width; height: 20 + } + Row{ + height: childrenRect.height; + spacing: 4 + TestText { + text: s.text + " thisisaverylongstringwithnospaces"; width: 150; wrapMode: Text.WrapAnywhere + } + TestText { + text: s.text + " thisisaverylongstringwithnospaces"; width: 150; wrapMode: Text.Wrap + } + TestText { + text: s.text; font.pixelSize: 18; style: Text.Outline; styleColor: "white"; wrapMode: Text.WordWrap; width: 200 + } + } + } +} |