summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qmlvisual/qdeclarativetext/font
diff options
context:
space:
mode:
authorYann Bodson <yann.bodson@nokia.com>2010-11-08 03:34:05 (GMT)
committerYann Bodson <yann.bodson@nokia.com>2010-11-08 03:36:40 (GMT)
commit0f1599edcc8624682efb9514bb9b4ac0519c7017 (patch)
treea55bfaea979c174d61d44015588cad3b3547504b /tests/auto/declarative/qmlvisual/qdeclarativetext/font
parentafa9d82702cbce1a23f951ed045d038f1d16b417 (diff)
downloadQt-0f1599edcc8624682efb9514bb9b4ac0519c7017.zip
Qt-0f1599edcc8624682efb9514bb9b4ac0519c7017.tar.gz
Qt-0f1599edcc8624682efb9514bb9b4ac0519c7017.tar.bz2
Text alignment is broken with multi-line text and implicit size.
Also add some visual tests for multi-line text elememts. Task-number: QTBUG-15018
Diffstat (limited to 'tests/auto/declarative/qmlvisual/qdeclarativetext/font')
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/font/TestText.qml13
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext3.0.pngbin0 -> 53503 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext3.qml11
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/plaintext3.0.pngbin0 -> 53503 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/plaintext3.qml11
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/font/plaintext3.qml62
6 files changed, 97 insertions, 0 deletions
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/TestText.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/TestText.qml
new file mode 100644
index 0000000..690cb15
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/TestText.qml
@@ -0,0 +1,13 @@
+import QtQuick 1.0
+
+Text {
+ id: testText
+
+ property color bcolor: "blue"
+
+ text: "The quick brown fox\njumps over\nthe lazy dog."
+ font.family: "Helvetica"
+ font.pointSize: 16
+
+ Rectangle { id: borderr; color: "transparent"; border.color: bcolor; anchors.fill: parent; opacity: 0.2 }
+}
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
new file mode 100644
index 0000000..0d3c672
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext3.0.png
Binary files differ
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 0000000..13f413a
--- /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/plaintext3.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/plaintext3.0.png
new file mode 100644
index 0000000..0d3c672
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/plaintext3.0.png
Binary files differ
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 0000000..13f413a
--- /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/plaintext3.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/plaintext3.qml
new file mode 100644
index 0000000..087dfbe
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/plaintext3.qml
@@ -0,0 +1,62 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: main
+ width: 800; height: 600
+
+
+ Grid {
+ x: 4; y: 4
+ spacing: 8
+ columns: 4
+
+ Column {
+ spacing: 4
+ TestText { }
+ TestText { horizontalAlignment: Text.AlignHCenter }
+ TestText { horizontalAlignment: Text.AlignRight }
+ }
+
+ Column {
+ spacing: 4
+ TestText { wrapMode: Text.Wrap }
+ TestText { horizontalAlignment: Text.AlignHCenter; wrapMode: Text.Wrap }
+ TestText { horizontalAlignment: Text.AlignRight; wrapMode: Text.Wrap }
+ }
+
+ Column {
+ spacing: 4
+ TestText { wrapMode: Text.Wrap; elide: Text.ElideRight }
+ TestText { horizontalAlignment: Text.AlignHCenter; wrapMode: Text.Wrap; elide: Text.ElideRight }
+ TestText { horizontalAlignment: Text.AlignRight; wrapMode: Text.Wrap; elide: Text.ElideRight }
+ }
+
+ Column {
+ spacing: 4
+ TestText { width: 230; wrapMode: Text.Wrap; elide: Text.ElideRight }
+ TestText { width: 230; horizontalAlignment: Text.AlignHCenter; wrapMode: Text.Wrap; elide: Text.ElideRight }
+ TestText { width: 230; horizontalAlignment: Text.AlignRight; wrapMode: Text.Wrap; elide: Text.ElideRight }
+ }
+
+ Column {
+ spacing: 4
+ TestText { width: 120; wrapMode: Text.Wrap; elide: Text.ElideRight }
+ TestText { width: 120; horizontalAlignment: Text.AlignHCenter; wrapMode: Text.Wrap; elide: Text.ElideRight }
+ TestText { width: 120; horizontalAlignment: Text.AlignRight; wrapMode: Text.Wrap; elide: Text.ElideRight }
+ }
+
+ Column {
+ spacing: 4
+ TestText { width: 120; wrapMode: Text.Wrap }
+ TestText { width: 120; horizontalAlignment: Text.AlignHCenter; wrapMode: Text.Wrap }
+ TestText { width: 120; horizontalAlignment: Text.AlignRight; wrapMode: Text.Wrap }
+ }
+
+ Column {
+ spacing: 4
+ TestText { width: 120 }
+ TestText { width: 120; horizontalAlignment: Text.AlignHCenter }
+ TestText { width: 120; horizontalAlignment: Text.AlignRight }
+ }
+ }
+}