def _lower_handler(self):
"""
Handle lower bound entries. Turn pink of the value is bad.
"""
success = True
try:
value = float(self._lower.text())
if value > self._p.guess:
raise ValueError
except ValueError:
success = False
if success:
color = "#FFFFFF"
else:
color = "#FFB6C1"
self._lower.setStyleSheet("QLineEdit {{ background-color: {} }}".format(color))
if success:
self._p.bounds = [value,self._p.bounds[1]]
self._current_lower = value
self._fit.emit_changed()
评论列表
文章目录