Changeset fbfc488 in sasview for src/sas/qtgui/Perspectives/Fitting
- Timestamp:
- Nov 9, 2017 8:43:55 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:
- d6b8a1d
- Parents:
- 7969b9c
- git-author:
- Piotr Rozyczko <rozyczko@…> (11/03/17 10:58:39)
- git-committer:
- Piotr Rozyczko <rozyczko@…> (11/09/17 08:43:55)
- Location:
- src/sas/qtgui/Perspectives/Fitting
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
r4992ff2 rfbfc488 61 61 QtGui.QStandardItemModel.__init__(self,parent) 62 62 63 def headerData(self, section, orientation, role ):63 def headerData(self, section, orientation, role=QtCore.Qt.DisplayRole): 64 64 """ 65 65 Displays tooltip for each column's header … … 592 592 elif model_column in [self.lstPoly.itemDelegate().poly_min, self.lstPoly.itemDelegate().poly_max]: 593 593 try: 594 value = float(item.text())594 value = GuiUtils.toDouble(item.text()) 595 595 except ValueError: 596 596 # Can't be converted properly, bring back the old value and exit … … 607 607 else: 608 608 try: 609 value = float(item.text())609 value = GuiUtils.toDouble(item.text()) 610 610 except ValueError: 611 611 # Can't be converted properly, bring back the old value and exit … … 624 624 model_row = item.row() 625 625 name_index = self._magnet_model.index(model_row, 0) 626 parameter_name = str(self._magnet_model.data(name_index) .toPyObject())626 parameter_name = str(self._magnet_model.data(name_index)) 627 627 628 628 if model_column == 0: … … 640 640 # Extract changed value. 641 641 try: 642 value = float(item.text())642 value = GuiUtils.toDouble(item.text()) 643 643 except ValueError: 644 644 # Unparsable field 645 645 return 646 646 647 property_index = self._magnet_model.headerData( 0, 1, model_column).toInt()[0]-1 # Value, min, max, etc.647 property_index = self._magnet_model.headerData(1, model_column)-1 # Value, min, max, etc. 648 648 649 649 # Update the parameter value - note: this supports +/-inf as well … … 1304 1304 # Extract changed value. 1305 1305 try: 1306 value = float(item.text())1306 value = GuiUtils.toDouble(item.text()) 1307 1307 except ValueError: 1308 1308 # Unparsable field 1309 1309 return 1310 parameter_name = str(self._model_model.data(name_index)) #.toPyObject()) # sld, background etc. 1310 1311 parameter_name = str(self._model_model.data(name_index)) # sld, background etc. 1311 1312 1312 1313 # Update the parameter value - note: this supports +/-inf as well … … 1687 1688 datafile = QtWidgets.QFileDialog.getOpenFileName( 1688 1689 self, "Choose a weight file", "", "All files (*.*)", None, 1689 QtWidgets.QFileDialog.DontUseNativeDialog) 1690 1691 if datafile is None or str(datafile)=='':1690 QtWidgets.QFileDialog.DontUseNativeDialog)[0] 1691 1692 if not datafile: 1692 1693 logging.info("No weight data chosen.") 1693 1694 raise IOError -
src/sas/qtgui/Perspectives/Fitting/ViewDelegate.py
r7969b9c rfbfc488 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.