下面的代码创建了一个应用QSS样式表的QLineEdit()
。如果您演示如何使用QSS更改QLineEdit
的字体大小和字体颜色,我将不胜感激。我试过了font-size: 12;
。但不起作用。
from PyQt4.QtCore import *
from PyQt4.QtGui import *
app=QApplication([])
bgColor='#262626'
style="""QLineEdit{{ color: #EBEBEB; border: 0px solid black; background-color: {0}; color: #EBEBEB }} QLineEdit:hover{{ border: 1px solid #ffa02f;}}""".format(bgColor)
lineEdit=QLineEdit()
lineEdit.setText('My Line Edit')
lineEdit.setStyleSheet(style)
lineEdit.show()
sys.exit(app.exec_())
发布于 2015-01-17 02:27:50
用单位指定字体大小;类似于px
、pt
font-size: 30px;
https://stackoverflow.com/questions/27995535
复制相似问题