diff options
author | Yann Bodson <yann.bodson@nokia.com> | 2010-11-08 03:34:05 (GMT) |
---|---|---|
committer | Yann Bodson <yann.bodson@nokia.com> | 2010-11-08 03:36:40 (GMT) |
commit | 0f1599edcc8624682efb9514bb9b4ac0519c7017 (patch) | |
tree | a55bfaea979c174d61d44015588cad3b3547504b /tests/auto/declarative/qmlvisual/qdeclarativetext/font | |
parent | afa9d82702cbce1a23f951ed045d038f1d16b417 (diff) | |
download | Qt-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')
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 Binary files differnew file mode 100644 index 0000000..0d3c672 --- /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 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 Binary files differnew file mode 100644 index 0000000..0d3c672 --- /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 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 } + } + } +} |