[solved]How to set multiline text in qlineedit



  • Is it possible to set set multiline placeholder text in Qlineedit?



  • No. QLineEdit is, as the name suggests, for editing a line of text and can only display a single line of input or placeholder. If you are trying to put instructions in the box then you could use the tool tip. If you want to display or edit multiple lines look at QTextEdit or QPlainTextEdit.



  • thanks chris,
    I reimplemented Qtextedit and created setplaceholder property in textedit. But I have a problem, I reimplement QtextEdit as myTextEdit, So every time i create new textedit widget at runtimeonly, Is it possible to create at Qt designer or how can I set reimplemented placeholder text property to ui->Textedit objects?



  • Hi,

    is not clear: it seems you're talking about two different things, the default placeholderText property and your "setplaceholder" property, or? What are you trying to achieve?



  • yep, Its two different properties..



  • You can use the Designer Promote feature to insert your custom widget in place of a standard QTextEdit. You will not be able to set your custom property through Designer unless you go through the process of building a Designer plugin for your custom widget.



  • Thanks for your reply Chris,

    I got another way, To create separate object from that reimplemented class and assign it to designer widget..


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.