[moved] Qt - How to set the PlaceHolderText for a QTextEdit?
Hi Nokia Developers,
I'm New to this Nokia Developer Community. And This is my First Post. Sorry if i Wrote anything Wrong. I am just creating an Qt application which has a [B]QLineEdit[/B] and a [B]QTextEdit[/B]. I just want to set a [B]PlaceHolderText[/B] for QLineEdit & QTextEdit. I know how to [I]set it for a QLineEdit.[/I]
QLineEdit has a property called [B][U]setPlaceHolderText[/U][/B]. But for a QTextEdit we dont have that property. Can anyone please suggest me to solve this.
Thanks & Regards.
Re: [moved] Qt - How to set the PlaceHolderText for a QTextEdit?
Firstly, you might want to consider using QML rather than the C++ classes (doesn't solve this problem, but QML is recommended for UI work).
There is no method for this as far as I can see. If I had to do it I'd wrap the QTextEdit in my own editor class, prepopulate it with my placeholder text, and delete the text when the widget first gets focus.