def validate_email(self, text): if "@" not in text: self.error_input.setStyleSheet("QLineEdit color: red; ") else: self.error_input.setStyleSheet("QLineEdit color: green; ")
line_edit = QLineEdit("Hello World") line_edit.setStyleSheet("QLineEdit color: blue; ") qlineedit text color
from PyQt5.QtGui import QPalette, QColor from PyQt5.QtWidgets import QLineEdit def validate_email(self, text): if "@" not in text: self