How set styleSheet for QLineEdit::placeholderText
-
@Mikeeeeee
There is no direct ability to affect the placeHolder text as a particular rule via stylesheet. If you stated what you want to do I could answer whether that can be done via stylesheet "trick" or whether you would have to it in code, but without knowing what you want to achieve I cannot. -
@Mikeeeeee
What is the point in my asking you "but without knowing what you want to achieve [i.e. what you want to do in the stylesheet rule] I cannot [tell you whether you can do it by stylesheet or have to do code]" if you don't address this in your reply? -
@Mikeeeeee
Oh for goodness sake. I already know that since you say it each time, I'm not stupid. I asked you what you want to be able to control about the placeholder text, in order to tell you whether/how it can be done by stylesheet.Since you refuse to answer I will just say
QLineEdit[text=""] { color: red; } // and possibly you *may* need, I don't know connect(ui->lineEdit, &QLineEdit::textChanged, [=]{ style()->polish(ui->lineEdit); });
and now I'm out of this question.