Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.0.3
-
None
-
Apple clang version 12.0.0 (clang-1200.0.32.29)
MacOS 11.2.3
-
-
72a3da3d4d (qt/qtbase/dev) 72a3da3d4d (qt/tqtc-qtbase/dev), c4635c0d5 (dev), a507ec80c (6.5), fbf948568 (6.6)
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
- Closed
- 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-21464 No way to change text colour in combobox button when using the GTK+ style
- Reported
-
QTBUG-93746 There's no PlaceholderText property in ColorGroup
- Closed
- resulted from
-
QTBUG-89815 [Reg 5.11->5.12.2] Wrong color for placeholder text for QLineEdit if disabled in constructor of parent
- Closed
For Gerrit Dashboard: QTBUG-93009 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
434310,3 | StyleSheetStyle: Fix color of placeholder texts in text edits | dev | qt/qtbase | Status: MERGED | +2 | 0 |
434311,3 | Style sheets: add placeholder text color property for edit widgets | dev | qt/qtbase | Status: MERGED | +2 | 0 |
435341,2 | StyleSheetStyle: Fix color of placeholder texts in text edits | 6.4 | qt/qtbase | Status: MERGED | +2 | 0 |
435346,2 | StyleSheetStyle: Fix color of placeholder texts in text edits | tqtc/lts-5.15 | qt/tqtc-qtbase | Status: MERGED | +2 | 0 |
435347,2 | StyleSheetStyle: Fix color of placeholder texts in text edits | tqtc/lts-6.2 | qt/tqtc-qtbase | Status: MERGED | +2 | 0 |
482633,5 | QStyleSheetStyle: Default to foreground for unset brushes only | dev | qt/qtbase | Status: MERGED | +2 | 0 |
483995,2 | QStyleSheetStyle: Default to foreground for unset brushes only | 6.6 | qt/qtbase | Status: MERGED | +2 | 0 |
483996,2 | QStyleSheetStyle: Default to foreground for unset brushes only | 6.5 | qt/qtbase | Status: MERGED | +2 | 0 |