QLineEdit Is a single line text box .

    QTextEdit Is a multiline text box .



(1) Single line text box QLineEdit

Common methods and attributes :

  (a) Gets and sets text alignment
Qt::Alignment alignment () const void setAlignment ( Qt::Alignment flag )
  (b) Gets and sets the contents of the file box
QString text () const void setText ( const QString & )
  (c) Gets and sets the selected text
QString selectedText () const void QLineEdit::setSelection ( int start, int
length )
  (d) Get and set echoMode pattern
EchoMode echoMode () const void setEchoMode ( EchoMode )
echoMode The value of the pattern can be :
QLineEdit::Normal 0 Display characters as they are entered. This is the
default. QLineEdit::NoEcho 1 Do not display anything. This may be appropriate
for passwords where even the length of the password should be kept secret.
QLineEdit::Password 2 Display asterisks instead of the characters actually
entered. QLineEdit::PasswordEchoOnEdit 3 Display characters as they are entered
while editing otherwise display asterisks.

(2) Multiline text box QTextEdit
   QTextEdit Show multiline text content , When the text content is beyond the display range of the control , Horizontal and vertical scrollbars can be displayed .

  By setting acceptRichText attribute ,QTextEdit Not only can text be displayed , You can also display HTML file , image , Table and other elements .


Examples :

(1) Sets the contents of a multiline text box :

(2) Gets the contents of a multiline text box :
QString str; str = textEdt->toPlainText();


©2019-2020 Toolsou All rights reserved,
be based on RK3399 PWM Drive development ( Essence )2020 year 6 month 26 day C# Class library GUID Help class python Short circuit logic in el-select Get selected label value Maximum security risk of cloud computing : Unclear safety responsibility Android 11 Official release ! The project followed for a year , The customer finally said no SpringMVC Frame in controller Layer gets the property value of the custom configuration file SSM Project's excel File upload and add to database Shortest path Dijkstra (Python3)