summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@qt.io>2021-01-05 15:42:48 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-01-12 21:20:16 +0000
commita6aa9bca33dd6c0d0312ff50a547950530943cee (patch)
tree7ba09045f7d5513225fda58c54d9ceb2abf42e48 /tests/auto
parent80a0119012db15b2664716463338db706c6a8085 (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/auto')
-rw-r--r--tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp16
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 a751fae05d..07a2a0bf67 100644
--- a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
+++ b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
@@ -124,6 +124,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();
@@ -2222,6 +2223,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"