Changeset 0261bc1 in sasview for src/sas/qtgui/Utilities/GuiUtils.py
- Timestamp:
- Nov 20, 2017 5:55:30 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:
- f1ec901
- Parents:
- 6a3e1fe
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Utilities/GuiUtils.py
r6a3e1fe r0261bc1 271 271 """ 272 272 def __init__(self, parent=None): 273 super( QtGui.QStandardItem, self).__init__()273 super(HashableStandardItem, self).__init__() 274 274 275 275 def __hash__(self): … … 277 277 #return hash(self.__init__) 278 278 return 0 279 280 def clone(self): 281 ''' Assure __hash__ is cloned as well''' 282 clone = super(HashableStandardItem, self).clone() 283 clone.__hash__ = self.__hash__ 284 return clone 279 285 280 286 … … 561 567 with open(path,'w') as out: 562 568 has_errors = True 563 if data.dy is None or not data.dy :569 if data.dy is None or not data.dy.any(): 564 570 has_errors = False 565 571 # Sanity check … … 571 577 has_errors = False 572 578 if has_errors: 573 if data.dx is not None and data.dx :579 if data.dx is not None and data.dx.any(): 574 580 out.write("<X> <Y> <dY> <dX>\n") 575 581 else: … … 580 586 for i in range(len(data.x)): 581 587 if has_errors: 582 if data.dx is not None and data.dx :588 if data.dx is not None and data.dx.any(): 583 589 if data.dx[i] is not None: 584 590 out.write("%g %g %g %g\n" % (data.x[i], … … 857 863 return value[0] 858 864 else: 859 raise ValueError865 raise TypeError 860 866 861 867 class DoubleValidator(QtGui.QDoubleValidator): … … 867 873 Return invalid for commas 868 874 """ 869 if (',' in input):875 if input is not None and ',' in input: 870 876 return (QtGui.QValidator.Invalid, input, pos) 871 877 return super(DoubleValidator, self).validate(input, pos) … … 875 881 Correct (remove) potential preexisting content 876 882 """ 877 QtGui.QDoubleValidator.fixup(input)883 super(DoubleValidator, self).fixup(input) 878 884 input = input.replace(",", "") 879 885
Note: See TracChangeset
for help on using the changeset viewer.