Details
-
Type:
Bug
-
Status: Reported
-
Priority:
P2: Important
-
Resolution: Unresolved
-
Affects Version/s: 6.0.3
-
Fix Version/s: None
-
Component/s: Widgets: Style Sheets
-
Labels:None
-
Environment:Apple clang version 12.0.0 (clang-1200.0.32.29)
MacOS 11.2.3
-
Platform/s:
Description
I'm finding that the color of the placeholder text cannot be changed once I've set the (for example) QLineEdit's color via a stylesheet (see the code snippet below).
Running the code below, both the placeholder text and the text the user types into the QLineEdit are blue.
However, if I comment out the setStyleSheet line below, I find that the placeholder text is green and the text the user types in is white.
QLineEdit *pLine = new QLineEdit; pLine->setPlaceholderText("helpful"); pLine->setStyleSheet("QLineEdit {color: rgb(0,0,255);}"); QPalette palette = pLine->palette(); palette.setColor(QPalette::PlaceholderText, QColor(0,255,0)); pLine->setPalette(palette);
Attachments
Issue Links
- is duplicated by
-
QTBUG-92199 [REG] The color of QLineEdit and QPlainTextEdit placeholder text is not grayed-out if stylesheet was applied
-
- Reported
-
- relates to
-
QTBUG-92947 QPalette doesn't return the correct color when querying QPalette::PlaceholderText
-
- Reported
-
-
QTBUG-86195 QLineEdit placeholderText is black instead of grey
-
- Reported
-
-
QTBUG-7854 Additional Supported CSS/HTML tag: line-height
-
- Closed
-
-
QTBUG-93746 There's no PlaceholderText property in ColorGroup
-
- Closed
-