from PyQt4 import QtCore as qcore QtGui as qgui class BlinkedLineEdit

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
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)