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].
QLineEdit
的placeholderText
属性正是您所需要的。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.