Changeset e4676c8 in sasview for src/sas/qtgui/GuiUtils.py
- Timestamp:
- Nov 3, 2016 6:07:10 AM (7 years ago)
- Branches:
- ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
- Children:
- ca8b853
- Parents:
- f140169
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/GuiUtils.py
- Property mode changed from 100755 to 100644
r39551a68 re4676c8 25 25 #from sas.sasgui.guiframe.events import StatusEvent 26 26 #from sas.sasgui.guiframe.events import NewPlotEvent 27 28 from periodictable import formula as Formula 27 29 28 30 from sas.sasgui.guiframe.dataFitting import Data1D … … 535 537 if os.path.splitext(filename)[1].lower() == ext_format: 536 538 loader.save(filename, data, ext_format) 539 540 class FormulaValidator(QtGui.QValidator): 541 def __init__(self, parent=None): 542 super(FormulaValidator, self).__init__(parent) 543 544 def validate(self, input, pos): 545 try: 546 Formula(str(input)) 547 self._setStyleSheet("") 548 return QtGui.QValidator.Acceptable, pos 549 550 except Exception as e: 551 self._setStyleSheet("background-color:pink;") 552 return QtGui.QValidator.Intermediate, pos 553 554 def _setStyleSheet(self, value): 555 try: 556 if self.parent(): 557 self.parent().setStyleSheet(value) 558 except: 559 pass
Note: See TracChangeset
for help on using the changeset viewer.