From 77a693cb41ac6b24ef6a4d8af0d041e26b862563 Mon Sep 17 00:00:00 2001 From: Yulong Bai Date: Wed, 7 Feb 2018 16:46:32 +0100 Subject: 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 --- tests/auto/controls/data/tst_textfield.qml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'tests/auto/controls/data/tst_textfield.qml') 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 + } + + } } -- cgit v1.2.3