hi friends,
can any one please clarify my doubt .. where should i use QLineEdit at exact situation ...
where i can replace QLineEdit with QTextEdit and inverse ...
generally i am asking this question ...
hi friends,
can any one please clarify my doubt .. where should i use QLineEdit at exact situation ...
where i can replace QLineEdit with QTextEdit and inverse ...
generally i am asking this question ...
"Behind every great fortune lies a crime" - Balzac
as the name suggesst.. use line edit when there are few words to enter without line break.(name, password, phone, etc)
wagmare (19th July 2009)
My humble advice: Default to using a QLineEdit; use a QTextEdit when you allow the user to enter long free-form (possibly rich/HTML) text.
QLineEdit is better for validating user input. QLineEdit has inputMask and validator. Of course, you can validate any text you want (including QLineEdit and QTextEdit) with a regular expression.
Use QLineEdit when the user enters a password. Set the echoMode.
Use QLineEdit when you would like to suggest valid values via its completer.
QLineEdit does support rich text, but in this case use a QTextEdit instead.
In the small number of cases where both a QLineEdit and a QTextEdit can be used interchangeably, use a QLineEdit.
wagmare (19th July 2009)
Thanks to both ...
but is there any advantage of QTextEdit over QLineEdit() other than long stream strings .. just asking because now i am going to use default text enter all to QLineEdit .
"Behind every great fortune lies a crime" - Balzac
text edit can render html... i dont know why you are so confused.? just like radiobutton and pushbutton are two different things for two different problems... similarly textedit and lineedit are different. and if you use one in place of another it will look odd,.
exactly ... i use QLineEdit instead of QTextEdit() to get stdOut of a linux command ethtool test ...using QProcess()
it returns only one line but actual ethtool returns six lines .. so now i am cleared thanks for the reply ...
"Behind every great fortune lies a crime" - Balzac
If you have simple text, go for QLineEdit, else if you have html, rich text, images, etc then you need to opt for QTextEdit. You cant embedd a table inside a QLineEdit, can u ?
Bookmarks