0
votes

The code below creates a single QLineEdit() with QSS stylesheet applied. I would appreciate if you show how to change the font size and font color of the QLineEdit using QSS. I have tried font-size: 12;. But it doesn't work.

enter image description here

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_())
1

1 Answers

2
votes

Specify a font size with a unit; something like px, pt:

font-size: 30px;