Q:

Qt5, set text size in lineEdit

Is it possible to change text size (and font too) in Qt5 QLineEdit class?
I looked in the official documentation but found no solution.
//the font I want to use to display a message
QFont littleFont("Courier New", 10);

//my message
QString strS = "hi all"

// setting the message in my lineEdit object
ui.lineEdit->setText(strS);

A:

As the others said in the comments:
You can set the font to the line edit using this line:
ui.lineEdit->setFont(littleFont);

This member function can be found in the Documentation by clicking on 

> List of all members, including inherited members

If you do not set all attributes of the Font be aware that the documentation states:

When you assign a new font to a widget, the properties from this font
  are combined with the widget's default font to form the widget's final
  font. You can call fontInfo() to get a copy of the widget's final
  font. The final font is also used to initialize QPainter's font.

