summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2010-10-29 01:05:49 (GMT)
committerAlan Alpert <alan.alpert@nokia.com>2010-10-29 01:05:49 (GMT)
commit3a784f3c74b10b898d40b06e82851929cba1eca2 (patch)
tree5d857d58f425b5adf33c69619106803e1a49dbe7
parent2c2e16dc5b43536eba6cb89c93401fed8f3c26a8 (diff)
downloadQt-3a784f3c74b10b898d40b06e82851929cba1eca2.zip
Qt-3a784f3c74b10b898d40b06e82851929cba1eca2.tar.gz
Qt-3a784f3c74b10b898d40b06e82851929cba1eca2.tar.bz2
Add a test for multiline text alignment
Apparently this is something we've had troubles with in the past Task-number: QTBUG-14792
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/align/data-X11/multilineAlign.0.pngbin0 -> 1895 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/align/data-X11/multilineAlign.qml247
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/align/data/multilineAlign.0.pngbin0 -> 1895 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/align/data/multilineAlign.qml247
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/align/multilineAlign.qml24
5 files changed, 518 insertions, 0 deletions
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/align/data-X11/multilineAlign.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/align/data-X11/multilineAlign.0.png
new file mode 100644
index 0000000..e6b2b3c
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/align/data-X11/multilineAlign.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/align/data-X11/multilineAlign.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/align/data-X11/multilineAlign.qml
new file mode 100644
index 0000000..1b43aa3
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/align/data-X11/multilineAlign.qml
@@ -0,0 +1,247 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ hash: "1ec47db85ba34bf1900445a2ab87b5e3"
+ }
+ Frame {
+ msec: 32
+ hash: "1ec47db85ba34bf1900445a2ab87b5e3"
+ }
+ Frame {
+ msec: 48
+ hash: "1ec47db85ba34bf1900445a2ab87b5e3"
+ }
+ Frame {
+ msec: 64
+ hash: "1ec47db85ba34bf1900445a2ab87b5e3"
+ }
+ Frame {
+ msec: 80
+ hash: "1ec47db85ba34bf1900445a2ab87b5e3"
+ }
+ Frame {
+ msec: 96
+ hash: "1ec47db85ba34bf1900445a2ab87b5e3"
+ }
+ Frame {
+ msec: 112
+ hash: "1ec47db85ba34bf1900445a2ab87b5e3"
+ }
+ Frame {
+ msec: 128
+ hash: "1ec47db85ba34bf1900445a2ab87b5e3"
+ }
+ Frame {
+ msec: 144
+ hash: "1ec47db85ba34bf1900445a2ab87b5e3"
+ }
+ Frame {
+ msec: 160
+ hash: "1ec47db85ba34bf1900445a2ab87b5e3"
+ }
+ Frame {
+ msec: 176
+ hash: "1fc2a63fa95e277bed60abfdecc7c82f"
+ }
+ Frame {
+ msec: 192
+ hash: "1fc2a63fa95e277bed60abfdecc7c82f"
+ }
+ Frame {
+ msec: 208
+ hash: "1fc2a63fa95e277bed60abfdecc7c82f"
+ }
+ Frame {
+ msec: 224
+ hash: "1fc2a63fa95e277bed60abfdecc7c82f"
+ }
+ Frame {
+ msec: 240
+ hash: "1fc2a63fa95e277bed60abfdecc7c82f"
+ }
+ Frame {
+ msec: 256
+ hash: "1fc2a63fa95e277bed60abfdecc7c82f"
+ }
+ Frame {
+ msec: 272
+ hash: "1fc2a63fa95e277bed60abfdecc7c82f"
+ }
+ Frame {
+ msec: 288
+ hash: "1fc2a63fa95e277bed60abfdecc7c82f"
+ }
+ Frame {
+ msec: 304
+ hash: "1fc2a63fa95e277bed60abfdecc7c82f"
+ }
+ Frame {
+ msec: 320
+ hash: "1fc2a63fa95e277bed60abfdecc7c82f"
+ }
+ Frame {
+ msec: 336
+ hash: "3a4e863d83f5d475e0c8c5121905bd87"
+ }
+ Frame {
+ msec: 352
+ hash: "3a4e863d83f5d475e0c8c5121905bd87"
+ }
+ Frame {
+ msec: 368
+ hash: "3a4e863d83f5d475e0c8c5121905bd87"
+ }
+ Frame {
+ msec: 384
+ hash: "3a4e863d83f5d475e0c8c5121905bd87"
+ }
+ Frame {
+ msec: 400
+ hash: "3a4e863d83f5d475e0c8c5121905bd87"
+ }
+ Frame {
+ msec: 416
+ hash: "3a4e863d83f5d475e0c8c5121905bd87"
+ }
+ Frame {
+ msec: 432
+ hash: "3a4e863d83f5d475e0c8c5121905bd87"
+ }
+ Frame {
+ msec: 448
+ hash: "3a4e863d83f5d475e0c8c5121905bd87"
+ }
+ Frame {
+ msec: 464
+ hash: "3a4e863d83f5d475e0c8c5121905bd87"
+ }
+ Frame {
+ msec: 480
+ hash: "3a4e863d83f5d475e0c8c5121905bd87"
+ }
+ Frame {
+ msec: 496
+ hash: "8887c8f40667f65a814d74b6edcfb81c"
+ }
+ Frame {
+ msec: 512
+ hash: "8887c8f40667f65a814d74b6edcfb81c"
+ }
+ Frame {
+ msec: 528
+ hash: "8887c8f40667f65a814d74b6edcfb81c"
+ }
+ Frame {
+ msec: 544
+ hash: "8887c8f40667f65a814d74b6edcfb81c"
+ }
+ Frame {
+ msec: 560
+ hash: "8887c8f40667f65a814d74b6edcfb81c"
+ }
+ Frame {
+ msec: 576
+ hash: "8887c8f40667f65a814d74b6edcfb81c"
+ }
+ Frame {
+ msec: 592
+ hash: "8887c8f40667f65a814d74b6edcfb81c"
+ }
+ Frame {
+ msec: 608
+ hash: "8887c8f40667f65a814d74b6edcfb81c"
+ }
+ Frame {
+ msec: 624
+ hash: "8887c8f40667f65a814d74b6edcfb81c"
+ }
+ Frame {
+ msec: 640
+ hash: "8887c8f40667f65a814d74b6edcfb81c"
+ }
+ Frame {
+ msec: 656
+ hash: "436000b48f688120d96919227d9e67b4"
+ }
+ Frame {
+ msec: 672
+ hash: "436000b48f688120d96919227d9e67b4"
+ }
+ Frame {
+ msec: 688
+ hash: "436000b48f688120d96919227d9e67b4"
+ }
+ Frame {
+ msec: 704
+ hash: "436000b48f688120d96919227d9e67b4"
+ }
+ Frame {
+ msec: 720
+ hash: "436000b48f688120d96919227d9e67b4"
+ }
+ Frame {
+ msec: 736
+ hash: "436000b48f688120d96919227d9e67b4"
+ }
+ Frame {
+ msec: 752
+ hash: "436000b48f688120d96919227d9e67b4"
+ }
+ Frame {
+ msec: 768
+ hash: "436000b48f688120d96919227d9e67b4"
+ }
+ Frame {
+ msec: 784
+ hash: "436000b48f688120d96919227d9e67b4"
+ }
+ Frame {
+ msec: 800
+ hash: "436000b48f688120d96919227d9e67b4"
+ }
+ Frame {
+ msec: 816
+ hash: "436000b48f688120d96919227d9e67b4"
+ }
+ Frame {
+ msec: 832
+ hash: "436000b48f688120d96919227d9e67b4"
+ }
+ Frame {
+ msec: 848
+ hash: "436000b48f688120d96919227d9e67b4"
+ }
+ Frame {
+ msec: 864
+ hash: "436000b48f688120d96919227d9e67b4"
+ }
+ Frame {
+ msec: 880
+ hash: "436000b48f688120d96919227d9e67b4"
+ }
+ Frame {
+ msec: 896
+ hash: "436000b48f688120d96919227d9e67b4"
+ }
+ Frame {
+ msec: 912
+ hash: "436000b48f688120d96919227d9e67b4"
+ }
+ Frame {
+ msec: 928
+ hash: "436000b48f688120d96919227d9e67b4"
+ }
+ Frame {
+ msec: 944
+ hash: "436000b48f688120d96919227d9e67b4"
+ }
+ Frame {
+ msec: 960
+ image: "multilineAlign.0.png"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/align/data/multilineAlign.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/align/data/multilineAlign.0.png
new file mode 100644
index 0000000..e6b2b3c
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/align/data/multilineAlign.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/align/data/multilineAlign.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/align/data/multilineAlign.qml
new file mode 100644
index 0000000..1b43aa3
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/align/data/multilineAlign.qml
@@ -0,0 +1,247 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ hash: "1ec47db85ba34bf1900445a2ab87b5e3"
+ }
+ Frame {
+ msec: 32
+ hash: "1ec47db85ba34bf1900445a2ab87b5e3"
+ }
+ Frame {
+ msec: 48
+ hash: "1ec47db85ba34bf1900445a2ab87b5e3"
+ }
+ Frame {
+ msec: 64
+ hash: "1ec47db85ba34bf1900445a2ab87b5e3"
+ }
+ Frame {
+ msec: 80
+ hash: "1ec47db85ba34bf1900445a2ab87b5e3"
+ }
+ Frame {
+ msec: 96
+ hash: "1ec47db85ba34bf1900445a2ab87b5e3"
+ }
+ Frame {
+ msec: 112
+ hash: "1ec47db85ba34bf1900445a2ab87b5e3"
+ }
+ Frame {
+ msec: 128
+ hash: "1ec47db85ba34bf1900445a2ab87b5e3"
+ }
+ Frame {
+ msec: 144
+ hash: "1ec47db85ba34bf1900445a2ab87b5e3"
+ }
+ Frame {
+ msec: 160
+ hash: "1ec47db85ba34bf1900445a2ab87b5e3"
+ }
+ Frame {
+ msec: 176
+ hash: "1fc2a63fa95e277bed60abfdecc7c82f"
+ }
+ Frame {
+ msec: 192
+ hash: "1fc2a63fa95e277bed60abfdecc7c82f"
+ }
+ Frame {
+ msec: 208
+ hash: "1fc2a63fa95e277bed60abfdecc7c82f"
+ }
+ Frame {
+ msec: 224
+ hash: "1fc2a63fa95e277bed60abfdecc7c82f"
+ }
+ Frame {
+ msec: 240
+ hash: "1fc2a63fa95e277bed60abfdecc7c82f"
+ }
+ Frame {
+ msec: 256
+ hash: "1fc2a63fa95e277bed60abfdecc7c82f"
+ }
+ Frame {
+ msec: 272
+ hash: "1fc2a63fa95e277bed60abfdecc7c82f"
+ }
+ Frame {
+ msec: 288
+ hash: "1fc2a63fa95e277bed60abfdecc7c82f"
+ }
+ Frame {
+ msec: 304
+ hash: "1fc2a63fa95e277bed60abfdecc7c82f"
+ }
+ Frame {
+ msec: 320
+ hash: "1fc2a63fa95e277bed60abfdecc7c82f"
+ }
+ Frame {
+ msec: 336
+ hash: "3a4e863d83f5d475e0c8c5121905bd87"
+ }
+ Frame {
+ msec: 352
+ hash: "3a4e863d83f5d475e0c8c5121905bd87"
+ }
+ Frame {
+ msec: 368
+ hash: "3a4e863d83f5d475e0c8c5121905bd87"
+ }
+ Frame {
+ msec: 384
+ hash: "3a4e863d83f5d475e0c8c5121905bd87"
+ }
+ Frame {
+ msec: 400
+ hash: "3a4e863d83f5d475e0c8c5121905bd87"
+ }
+ Frame {
+ msec: 416
+ hash: "3a4e863d83f5d475e0c8c5121905bd87"
+ }
+ Frame {
+ msec: 432
+ hash: "3a4e863d83f5d475e0c8c5121905bd87"
+ }
+ Frame {
+ msec: 448
+ hash: "3a4e863d83f5d475e0c8c5121905bd87"
+ }
+ Frame {
+ msec: 464
+ hash: "3a4e863d83f5d475e0c8c5121905bd87"
+ }
+ Frame {
+ msec: 480
+ hash: "3a4e863d83f5d475e0c8c5121905bd87"
+ }
+ Frame {
+ msec: 496
+ hash: "8887c8f40667f65a814d74b6edcfb81c"
+ }
+ Frame {
+ msec: 512
+ hash: "8887c8f40667f65a814d74b6edcfb81c"
+ }
+ Frame {
+ msec: 528
+ hash: "8887c8f40667f65a814d74b6edcfb81c"
+ }
+ Frame {
+ msec: 544
+ hash: "8887c8f40667f65a814d74b6edcfb81c"
+ }
+ Frame {
+ msec: 560
+ hash: "8887c8f40667f65a814d74b6edcfb81c"
+ }
+ Frame {
+ msec: 576
+ hash: "8887c8f40667f65a814d74b6edcfb81c"
+ }
+ Frame {
+ msec: 592
+ hash: "8887c8f40667f65a814d74b6edcfb81c"
+ }
+ Frame {
+ msec: 608
+ hash: "8887c8f40667f65a814d74b6edcfb81c"
+ }
+ Frame {
+ msec: 624
+ hash: "8887c8f40667f65a814d74b6edcfb81c"
+ }
+ Frame {
+ msec: 640
+ hash: "8887c8f40667f65a814d74b6edcfb81c"
+ }
+ Frame {
+ msec: 656
+ hash: "436000b48f688120d96919227d9e67b4"
+ }
+ Frame {
+ msec: 672
+ hash: "436000b48f688120d96919227d9e67b4"
+ }
+ Frame {
+ msec: 688
+ hash: "436000b48f688120d96919227d9e67b4"
+ }
+ Frame {
+ msec: 704
+ hash: "436000b48f688120d96919227d9e67b4"
+ }
+ Frame {
+ msec: 720
+ hash: "436000b48f688120d96919227d9e67b4"
+ }
+ Frame {
+ msec: 736
+ hash: "436000b48f688120d96919227d9e67b4"
+ }
+ Frame {
+ msec: 752
+ hash: "436000b48f688120d96919227d9e67b4"
+ }
+ Frame {
+ msec: 768
+ hash: "436000b48f688120d96919227d9e67b4"
+ }
+ Frame {
+ msec: 784
+ hash: "436000b48f688120d96919227d9e67b4"
+ }
+ Frame {
+ msec: 800
+ hash: "436000b48f688120d96919227d9e67b4"
+ }
+ Frame {
+ msec: 816
+ hash: "436000b48f688120d96919227d9e67b4"
+ }
+ Frame {
+ msec: 832
+ hash: "436000b48f688120d96919227d9e67b4"
+ }
+ Frame {
+ msec: 848
+ hash: "436000b48f688120d96919227d9e67b4"
+ }
+ Frame {
+ msec: 864
+ hash: "436000b48f688120d96919227d9e67b4"
+ }
+ Frame {
+ msec: 880
+ hash: "436000b48f688120d96919227d9e67b4"
+ }
+ Frame {
+ msec: 896
+ hash: "436000b48f688120d96919227d9e67b4"
+ }
+ Frame {
+ msec: 912
+ hash: "436000b48f688120d96919227d9e67b4"
+ }
+ Frame {
+ msec: 928
+ hash: "436000b48f688120d96919227d9e67b4"
+ }
+ Frame {
+ msec: 944
+ hash: "436000b48f688120d96919227d9e67b4"
+ }
+ Frame {
+ msec: 960
+ image: "multilineAlign.0.png"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/align/multilineAlign.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/align/multilineAlign.qml
new file mode 100644
index 0000000..976f0b0
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/align/multilineAlign.qml
@@ -0,0 +1,24 @@
+import QtQuick 1.0
+
+/*Tests both the alignments of multiline text, and that
+ it can deal with changing them properly
+*/
+Item{
+ width: 100
+ height: 80
+ property int stage: 0
+ onStageChanged: if(stage == 6) Qt.quit();
+ Text{
+ text: "I am the very model of a modern major general."
+ anchors.fill: parent;
+ wrapMode: Text.WordWrap
+ horizontalAlignment: (stage<1 ? Text.AlignRight : (stage<3 ? Text.AlignHCenter : Text.AlignLeft))
+ verticalAlignment: (stage<2 ? Text.AlignBottom : (stage<4 ? Text.AlignVCenter : Text.AlignTop))
+ }
+ Timer{
+ interval: 160
+ running: true
+ repeat: true
+ onTriggered: stage += 1
+ }
+}