Reputation: 861
I have a QLineEdit
with the text "Search contents...".
I would like when QLineEdit
has the focus or when the cursor go inside the text that the text is set to an empty string. [This works: I have no problem, I used the cursorPositionChanged
signal of QLineEdit
].
I would like also when the QLineEdit
leaves the focus and if the text is empty that the text of the QLineEdit
is set to "Search contents...". [I don't know how to do that].
Upvotes: 1
Views: 514
Reputation: 107
The placeholderText
property of QLineEdit
is exactly what you need.
Upvotes: 2