Changeset 6280464 in sasview for src/sas/qtgui/Perspectives/Fitting
- Timestamp:
- Nov 3, 2017 10:58:39 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:
- 412e069e
- Parents:
- 304d082
- Location:
- src/sas/qtgui/Perspectives/Fitting
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
r0849aec r6280464 60 60 QtGui.QStandardItemModel.__init__(self,parent) 61 61 62 def headerData(self, section, orientation, role ):62 def headerData(self, section, orientation, role=QtCore.Qt.DisplayRole): 63 63 """ 64 64 Displays tooltip for each column's header … … 586 586 elif model_column in [self.lstPoly.itemDelegate().poly_min, self.lstPoly.itemDelegate().poly_max]: 587 587 try: 588 value = float(item.text())588 value = GuiUtils.toDouble(item.text()) 589 589 except ValueError: 590 590 # Can't be converted properly, bring back the old value and exit … … 601 601 else: 602 602 try: 603 value = float(item.text())603 value = GuiUtils.toDouble(item.text()) 604 604 except ValueError: 605 605 # Can't be converted properly, bring back the old value and exit … … 618 618 model_row = item.row() 619 619 name_index = self._magnet_model.index(model_row, 0) 620 parameter_name = str(self._magnet_model.data(name_index) .toPyObject())620 parameter_name = str(self._magnet_model.data(name_index)) 621 621 622 622 if model_column == 0: … … 634 634 # Extract changed value. 635 635 try: 636 value = float(item.text())636 value = GuiUtils.toDouble(item.text()) 637 637 except ValueError: 638 638 # Unparsable field 639 639 return 640 640 641 property_index = self._magnet_model.headerData(1, model_column) .toInt()[0]-1 # Value, min, max, etc.641 property_index = self._magnet_model.headerData(1, model_column)-1 # Value, min, max, etc. 642 642 643 643 # Update the parameter value - note: this supports +/-inf as well … … 1295 1295 # Extract changed value. 1296 1296 try: 1297 value = float(item.text())1297 value = GuiUtils.toDouble(item.text()) 1298 1298 except ValueError: 1299 1299 # Unparsable field 1300 1300 return 1301 parameter_name = str(self._model_model.data(name_index)) #.toPyObject()) # sld, background etc. 1301 1302 parameter_name = str(self._model_model.data(name_index)) # sld, background etc. 1302 1303 1303 1304 # Update the parameter value - note: this supports +/-inf as well … … 1678 1679 datafile = QtWidgets.QFileDialog.getOpenFileName( 1679 1680 self, "Choose a weight file", "", "All files (*.*)", None, 1680 QtWidgets.QFileDialog.DontUseNativeDialog) 1681 1682 if datafile is None or str(datafile)=='':1681 QtWidgets.QFileDialog.DontUseNativeDialog)[0] 1682 1683 if not datafile: 1683 1684 logging.info("No weight data chosen.") 1684 1685 raise IOError -
src/sas/qtgui/Perspectives/Fitting/ViewDelegate.py
r304d082 r6280464 4 4 5 5 import sas.qtgui.Utilities.GuiUtils as GuiUtils 6 7 class CommaLessValidator(QtGui.QDoubleValidator): 8 """ 9 Custom double validator which doesn't allow for commas to be used as decimal point 10 """ 11 pass 6 12 7 13 class ModelViewDelegate(QtWidgets.QStyledItemDelegate): … … 44 50 if index.column() in self.fancyColumns(): 45 51 # Units - present in nice HTML 46 #options = QtWidgets.QStyleOptionViewItemV4(option)47 52 options = QtWidgets.QStyleOptionViewItem(option) 48 53 self.initStyleOption(options,index) … … 236 241 def createEditor(self, widget, option, index): 237 242 # Remember the current choice 238 current_text = index.data() .toString()243 current_text = index.data() 239 244 if not index.isValid(): 240 245 return 0
Note: See TracChangeset
for help on using the changeset viewer.