×

Discussion Board

Results 1 to 2 of 2

Hybrid View

  1. #1
    Registered User
    Join Date
    Nov 2012
    Posts
    1

    [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 QLineEdit and a QTextEdit. I just want to set a PlaceHolderText for QLineEdit & QTextEdit. I know how to set it for a QLineEdit.
    QLineEdit has a property called setPlaceHolderText. But for a QTextEdit we dont have that property. Can anyone please suggest me to solve this.

    Thanks & Regards.

  2. #2
    Registered User
    Join Date
    Jan 2009
    Location
    Melbourne, Australia
    Posts
    2,571

    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.

Similar Threads

  1. QTextEdit maxlength
    By ayhanakbulut in forum Qt
    Replies: 4
    Last Post: 2011-02-25, 16:55

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×