aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/controls/data/tst_textfield.qml
diff options
context:
space:
mode:
authorYulong Bai <yulong.bai@qt.io>2018-02-07 16:46:32 +0100
committerYulong Bai <yulong.bai@qt.io>2018-02-15 14:43:31 +0000
commit77a693cb41ac6b24ef6a4d8af0d041e26b862563 (patch)
treeb717ab829d7e89e0037e162423aae31c8bd261ed /tests/auto/controls/data/tst_textfield.qml
parente689e8beb54c4a5101c105e52521251b314dd468 (diff)
QQuickTextField: add placeholderTextColor property
Add placeholderTextColor property for user convenience to customize the placeholderText color to fit the backgrounds. [ChangeLog][TextField] Added placeholderTextColor property for user convenience to customize the placeholderText color to fit the backgrounds. Task-number: QTBUG-66260 Change-Id: I9755ea5ccf2ff416846bdf130dbd352892fd40a2 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'tests/auto/controls/data/tst_textfield.qml')
-rw-r--r--tests/auto/controls/data/tst_textfield.qml17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_textfield.qml b/tests/auto/controls/data/tst_textfield.qml
index 0fee7363..1bdf5151 100644
--- a/tests/auto/controls/data/tst_textfield.qml
+++ b/tests/auto/controls/data/tst_textfield.qml
@@ -435,4 +435,21 @@ TestCase {
mouseClick(control, control.width / 2, control.height / 2, Qt.LeftButton | Qt.RightButton)
compare(control.selectedText, "")
}
+
+ // QTBUG-66260
+ function test_placeholderTextColor() {
+ var control = createTemporaryObject(textField, testCase)
+ verify(control)
+
+ // usually default value should not be pure opacue black
+ verify(control.placeholderTextColor !== "#ff000000")
+ control.placeholderTextColor = "#12345678"
+ compare(control.placeholderTextColor, "#12345678")
+
+ for (var i = 0; i < control.children.length; ++i) {
+ if (control.children[i].hasOwnProperty("text"))
+ compare(control.children[i].color, control.placeholderTextColor) // placeholder.color
+ }
+
+ }
}