Python PYQT QLineEdit font size

10,492

Solution 1

Try with:

f = self.texteditor1.font()
f.setPointSize(27) # sets the size to 27
self.texteditor1.setFont(f)

Solution 2

Set pointSize property of lineedit font.

self.texteditor1 = QtGui.QLineEdit(self)
font = self.texteditor1.font()      # lineedit current font
font.setPointSize(32)               # change it's size
self.texteditor1.setFont(font)      # set font
Share:
10,492

Related videos on Youtube

user2693313
Author by

user2693313

Updated on September 15, 2022

Comments

  • user2693313
    user2693313 almost 2 years

    I am creating a form using PYQT

    self.texteditor1= QtGui.QLineEdit(self) 
    self.texteditor1.setFixedWidth(560)
    

    I wanted to know that how to increase font size of texteditor in above case ?

  • user2693313
    user2693313 almost 9 years
    Thanks. Can you please tell that how to wrap text in the QLineEdit box ?
  • pacholik
    pacholik almost 9 years
    That won't happen on line. You will have to use different widget. Read some docs and if you find a problem, ask a new question.