建议你使用placeholderText
placeholderText : QString
This property holds the line edit's placeholder text.
Setting this property makes the line edit display a grayed-out placeholder text as long as the text() is empty and the widget doesn't have focus.
By default, this property contains an empty string.
This property was introduced in Qt 4.7.
Access functions:
QString placeholderText () const
void setPlaceholderText ( const QString & )