diff --git a/Orange/widgets/data/owsql.py b/Orange/widgets/data/owsql.py index 00471f0cf99..c4616582724 100644 --- a/Orange/widgets/data/owsql.py +++ b/Orange/widgets/data/owsql.py @@ -133,16 +133,17 @@ def __init__(self): def error(self, id=0, text=""): super().error(id, text) + err_style = 'QLineEdit {border: 2px solid red;}' if 'server' in text or 'host' in text: - self.servertext.setStyleSheet('QLineEdit {border: 2px solid red;}') + self.servertext.setStyleSheet(err_style) else: self.servertext.setStyleSheet('') if 'role' in text: - self.usernametext.setStyleSheet('QLineEdit {border: 2px solid red;}') + self.usernametext.setStyleSheet(err_style) else: self.usernametext.setStyleSheet('') if 'database' in text: - self.databasetext.setStyleSheet('QLineEdit {border: 2px solid red;}') + self.databasetext.setStyleSheet(err_style) else: self.databasetext.setStyleSheet('')