如何更改标签的字体(和字体大小)
答
基本上你需要QFont
(在setupUi
法或任何地方):
font = QtGui.QFont()
font.setFamily(_fromUtf8("FreeMono"))
font.setBold(True)
self.someLabel.setFont(font)
您还可以检查QFont参考。
P.S. _fromUtf8
是QtCore.QString.fromUtf8
导入为_fromUtf8