from PyQt4 import QtCore as qcore, QtGui as qgui
class BlinkedLineEdit(qgui.QLineEdit):
....
def __init__(self, *args):
super(BlinkedLineEdit, self).__init__(*args)
self._orig_css = self.styleSheet()
....
def setErrorState(self, timeout=800, css='background-color: antiquewhite'):
self.setStyleSheet(css)
qcore.QTimer.singleShot(timeout, self.resetErrorState)
....
def resetErrorState(self):
self.setStyleSheet(self._orig_css)