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
Related videos on Youtube
Author by
user2693313
Updated on September 15, 2022Comments
-
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 almost 9 yearsThanks. Can you please tell that how to wrap text in the QLineEdit box ?
-
pacholik almost 9 yearsThat 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.