QTextEdit default value

i am using pyqt5 and i am wondering how i can set a default text to a textedit widget? So that it shows for example "Type your name here" and when i type something the text goes away. Like on login pages. I am happy about every answer!

it should look like this:

here

disclaimer: I already searched on the internet but found nothing

Upvotes: 2

Views: 1838

Answers (1)

eyllanesc
eyllanesc

Reputation: 243887

You have to use property placeholderText :

text_edit.setPlaceholderText("Search")

Upvotes: 6

Related Questions