Answer the question
In order to leave comments, you need to log in
PyQt4 | How to change color for QTextEdit?
I wrote a code that doesn't work:
self.edit.color = QtGui.QColor("#7b3f00")
self.edit.setTextColor(self.edit.color)
Answer the question
In order to leave comments, you need to log in
# для изменения цвета текста
self.edit.setStyleSheet("QTextEdit {color:red}")
# для изменения цвета бэкграунда
self.edit.setStyleSheet("QTextEdit {background-color:red}")
# для изменения цвета текста
self.edit.setStyleSheet("QTextEdit {color:rgba(255, 0, 0, 255)}")
# для изменения цвета бэкграунда
self.edit.setStyleSheet("QTextEdit {background-color:rgba(255, 0, 0, 255)}")
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question