def _widget_checker(self):
"""
Make sure widgets are good, turning bad widgets pink.
"""
for k in self._arg_widgets.keys():
caster = self._arg_types[k]
if caster == bool:
continue
try:
value = caster(self._arg_widgets[k].text())
if type(value) is str and value.strip() == "":
raise ValueError
color = "#FFFFFF"
except ValueError:
color = "#FFB6C1"
self._arg_widgets[k].setStyleSheet("QLineEdit {{ background-color: {} }}".format(color))
评论列表
文章目录