Пример #1
0
 def check_float(self, cell):
     text = cell.text()
     try:
         value = eval_float_from_string(text)
         cell.setStyleSheet("QLineEdit{background: white;}")
         return value, True
     except ValueError:
         cell.setStyleSheet("QLineEdit{background: red;}")
         return None, False
Пример #2
0
 def check_float(cell):
     text = cell.text()
     try:
         value = eval_float_from_string(text)
         cell.setStyleSheet("QLineEdit{background: white;}")
         return value, True
     except ValueError:
         cell.setStyleSheet("QLineEdit{background: red;}")
         return None, False
Пример #3
0
 def _on_float(self, field):
     try:
         eval_float_from_string(field.text())
         field.setStyleSheet("QLineEdit{background: white;}")
     except ValueError:
         field.setStyleSheet("QLineEdit{background: red;}")