I am trying to create a demonstration app to show how to change font colors.
I can do it in QLabel and QTextEdit
I have found no way to change the foreground
this is how I do it not using css
Palette= QtGui.QPalette()
Palette.setColor(QtGui.QPalette.Text, QtCore.Qt.red)
self.lineEdit.setPalette(Palette)
QLineEdit has a method initStyleOption and initStyleOption inherits QStyleOption, and then QStyleOption has a Method QPalette. Now you can take advatage of using QPalette methods.
you can visit this link for reference http://pyqt.sourceforge.net/Docs/PyQt4/qlineedit.html