diff options
author | Andy Shaw <andy.shaw@qt.io> | 2021-01-05 15:42:48 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-01-28 06:53:46 +0000 |
commit | 5a9bcf5d06d8a3790000875ec9c347ccae587b8f (patch) | |
tree | 45f1890158db81343bdbb8337ce05a2aea9f50d2 /tests | |
parent | 84a4f1281d5d687bfdadafea9c5618780b1663b6 (diff) |
Set the PlaceholderText color in the palette from the stylesheet as well
The color should be used across the board, so the PlaceholderText color
should also be respecting the one passed for Text and so on.
Fixes: QTBUG-89815
Change-Id: I2accb3db35488f95a1c8ebacf2316a08ee416fac
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit bb00b63dee85bfe77bd721dd962c768e62c1b1e3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp index 82527849b0..26868a763c 100644 --- a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp +++ b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp @@ -126,6 +126,7 @@ private slots: void QTBUG15910_crashNullWidget(); void QTBUG36933_brokenPseudoClassLookup(); void styleSheetChangeBeforePolish(); + void placeholderColor(); //at the end because it mess with the style. void widgetStyle(); void appStyle(); @@ -2229,6 +2230,21 @@ void tst_QStyleSheetStyle::highdpiImages() QHighDpiScaling::updateHighDpiScaling(); // reset to normal } +void tst_QStyleSheetStyle::placeholderColor() +{ + const QColor red(Qt::red); + qApp->setStyleSheet("* { color: red; }"); + QLineEdit le1; + QLineEdit le2; + le2.setEnabled(false); + le1.ensurePolished(); + QCOMPARE(le1.palette().placeholderText(), red); + le2.ensurePolished(); + QCOMPARE(le2.palette().placeholderText(), red); + le2.setEnabled(true); + QCOMPARE(le2.palette().placeholderText(), red); +} + QTEST_MAIN(tst_QStyleSheetStyle) #include "tst_qstylesheetstyle.moc" |