I have got a QLabel (name) and corresponding QLineEdit.
I would like to check the value of the input field and set the color of he label to red in case a wrong value was inserted. Before doing that, I want to keep the current stylesheet of the label to be able to reset the label to its original value.
def checkData():
if self.title.text() == "":
*self*.titleLabel.setStyleSheet(*"color: red"*) # keep the current value?
*self*.title.setFocus()
return False
else:
*self*.titleLabel.setStyleSheet(*"color: blue"*) # set the original value
return True