aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@theqtcompany.com>2015-10-20 13:05:35 +0200
committerJ-P Nurmi <jpnurmi@theqtcompany.com>2015-10-20 13:31:01 +0000
commit594f55333b04603cad63323fc478565743077db2 (patch)
treed7cd382d53fdef3ff304a2f874cbf7225e5a2d40 /tests
parentaf531e14b31da62347fe489562951fdf7f378208 (diff)
TextArea & TextField: fix placeholder alignment
Placeholder text should follow the alignment of the control itself, so that text input appears in the same place where a placeholder was. Change-Id: I1dfa6c2aece10eb92e62a14f347c7e1ec5e610ea Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/controls/data/tst_textarea.qml14
-rw-r--r--tests/auto/controls/data/tst_textfield.qml14
2 files changed, 28 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_textarea.qml b/tests/auto/controls/data/tst_textarea.qml
index 2b612d07..1c31f435 100644
--- a/tests/auto/controls/data/tst_textarea.qml
+++ b/tests/auto/controls/data/tst_textarea.qml
@@ -83,4 +83,18 @@ TestCase {
compare(control.implicitHeight, 200)
control.destroy()
}
+
+ function test_alignment() {
+ var control = textArea.createObject(testCase)
+
+ control.horizontalAlignment = TextArea.AlignRight
+ compare(control.horizontalAlignment, TextArea.AlignRight)
+ compare(control.placeholder.horizontalAlignment, Text.AlignRight)
+
+ control.verticalAlignment = TextArea.AlignBottom
+ compare(control.verticalAlignment, TextArea.AlignBottom)
+ compare(control.placeholder.verticalAlignment, Text.AlignBottom)
+
+ control.destroy()
+ }
}
diff --git a/tests/auto/controls/data/tst_textfield.qml b/tests/auto/controls/data/tst_textfield.qml
index 2ceb0b36..a35b4a3a 100644
--- a/tests/auto/controls/data/tst_textfield.qml
+++ b/tests/auto/controls/data/tst_textfield.qml
@@ -87,4 +87,18 @@ TestCase {
compare(control.implicitHeight, 200)
control.destroy()
}
+
+ function test_alignment() {
+ var control = textField.createObject(testCase)
+
+ control.horizontalAlignment = TextField.AlignRight
+ compare(control.horizontalAlignment, TextField.AlignRight)
+ compare(control.placeholder.horizontalAlignment, Text.AlignRight)
+
+ control.verticalAlignment = TextField.AlignBottom
+ compare(control.verticalAlignment, TextField.AlignBottom)
+ compare(control.placeholder.verticalAlignment, Text.AlignBottom)
+
+ control.destroy()
+ }
}