我正在使用PYQT创建表单
self.texteditor1= QtGui.QLineEdit(self)
self.texteditor1.setFixedWidth(560)
我想知道在上面的情况下如何增加texteditor的字体大小?
答案 0 :(得分:1)
尝试:
f = self.texteditor1.font()
f.setPointSize(27) # sets the size to 27
self.texteditor1.setFont(f)
答案 1 :(得分:0)
设置lineedit字体的pointSize
属性。
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