diff options
author | Yulong Bai <yulong.bai@qt.io> | 2018-02-07 16:46:32 +0100 |
---|---|---|
committer | Yulong Bai <yulong.bai@qt.io> | 2018-02-15 14:43:31 +0000 |
commit | 77a693cb41ac6b24ef6a4d8af0d041e26b862563 (patch) | |
tree | b717ab829d7e89e0037e162423aae31c8bd261ed /tests/auto/controls/data/tst_textfield.qml | |
parent | e689e8beb54c4a5101c105e52521251b314dd468 (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.qml | 17 |
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 + } + + } } |