Changeset 412e069e in sasview for src/sas/qtgui/Perspectives/Fitting
- Timestamp:
- Nov 7, 2017 8:29:59 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:
- 3e8dee3
- Parents:
- 6280464
- Location:
- src/sas/qtgui/Perspectives/Fitting
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/FittingOptions.py
r0849aec r412e069e 88 88 validator.setBottom(0) 89 89 elif f_type == float: 90 validator = QtGui.QDoubleValidator()90 validator = GuiUtils.DoubleValidator() 91 91 validator.setBottom(0) 92 92 else: -
src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
r6280464 r412e069e 13 13 from PyQt5 import QtWidgets 14 14 from PyQt5 import QtWebKitWidgets 15 # Officially QtWebEngineWidgets are the way to display HTML in Qt5, 16 # but this module isn't ported to PyQt5 yet... 17 # let's wait. In the meantime no Help. 18 #from PyQt5 import QtWebEngineWidgets 15 19 16 20 from sasmodels import generate … … 50 54 DEFAULT_POLYDISP_FUNCTION = 'gaussian' 51 55 52 USING_TWISTED = True 56 #USING_TWISTED = True 57 USING_TWISTED = False 53 58 54 59 class ToolTippedItemModel(QtGui.QStandardItemModel): … … 463 468 menu = QtWidgets.QMenu() 464 469 label = QtWidgets.QLabel(msg) 465 action = Qt Gui.QWidgetAction(self)470 action = QtWidgets.QWidgetAction(self) 466 471 action.setDefaultWidget(label) 467 472 menu.addAction(action) … … 472 477 Respond to select Model from list event 473 478 """ 474 model = s tr(self.cbModel.currentText())479 model = self.cbModel.currentText() 475 480 476 481 # empty combobox forced to be read … … 528 533 Select Category from list 529 534 """ 530 category = s tr(self.cbCategory.currentText())535 category = self.cbCategory.currentText() 531 536 # Check if the user chose "Choose category entry" 532 537 if category == CATEGORY_DEFAULT: … … 674 679 helpfile = "mag_help.html" 675 680 help_location = tree_location + helpfile 681 682 content = QtCore.QUrl(help_location) 676 683 self.helpView.load(QtCore.QUrl(help_location)) 677 684 self.helpView.show() … … 727 734 fitter = Fit() 728 735 data = GuiUtils.dataFromItem(fit_index) 729 fitter.set_model(model, fit_id, params_to_fit, data=data, 736 try: 737 fitter.set_model(model, fit_id, params_to_fit, data=data, 730 738 constraints=constraints) 739 except ValueError as ex: 740 logging.error("Setting model parameters failed with: %s" % ex) 741 return 742 731 743 qmin, qmax, _ = self.logic.computeRangeFromData(data) 732 744 fitter.set_data(data=data, id=fit_id, smearer=smearer, qmin=qmin, … … 1513 1525 residuals_plot.id = "Residual " + residuals_plot.id 1514 1526 self.createNewIndex(residuals_plot) 1515 self.communicate.plotUpdateSignal.emit([residuals_plot])1527 #self.communicate.plotUpdateSignal.emit([residuals_plot]) 1516 1528 1517 1529 def calcException(self, etype, value, tb): -
src/sas/qtgui/Perspectives/Fitting/OptionsWidget.py
r0849aec r412e069e 8 8 9 9 from sas.qtgui.Plotting.PlotterData import Data2D 10 import sas.qtgui.Utilities.GuiUtils as GuiUtils 10 11 11 12 # Local UI … … 66 67 67 68 # Let only floats in the range edits 68 self.txtMinRange.setValidator( QtGui.QDoubleValidator())69 self.txtMaxRange.setValidator( QtGui.QDoubleValidator())69 self.txtMinRange.setValidator(GuiUtils.DoubleValidator()) 70 self.txtMaxRange.setValidator(GuiUtils.DoubleValidator()) 70 71 # Let only ints in the number of points edit 71 72 self.txtNpts.setValidator(QtGui.QIntValidator()) -
src/sas/qtgui/Perspectives/Fitting/SmearingWidget.py
r0849aec r412e069e 8 8 from sas.qtgui.Plotting.PlotterData import Data1D 9 9 from sas.qtgui.Plotting.PlotterData import Data2D 10 import sas.qtgui.Utilities.GuiUtils as GuiUtils 10 11 11 12 # Local UI … … 51 52 self.parent = parent 52 53 # Let only floats in the line edits 53 self.txtSmearDown.setValidator( QtGui.QDoubleValidator())54 self.txtSmearUp.setValidator( QtGui.QDoubleValidator())54 self.txtSmearDown.setValidator(GuiUtils.DoubleValidator()) 55 self.txtSmearUp.setValidator(GuiUtils.DoubleValidator()) 55 56 56 57 # Attach slots -
src/sas/qtgui/Perspectives/Fitting/ViewDelegate.py
r6280464 r412e069e 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 point10 """11 pass12 6 13 7 class ModelViewDelegate(QtWidgets.QStyledItemDelegate): … … 87 81 if index.column() == self.param_value: #only in the value column 88 82 editor = QtWidgets.QLineEdit(widget) 89 validator = QtGui.QDoubleValidator()83 validator = GuiUtils.DoubleValidator() 90 84 editor.setValidator(validator) 91 85 return editor … … 168 162 elif index.column() in self.editableParameters(): 169 163 self.editor = QtWidgets.QLineEdit(widget) 170 validator = QtGui.QDoubleValidator()164 validator = GuiUtils.DoubleValidator() 171 165 self.editor.setValidator(validator) 172 166 return self.editor … … 246 240 if index.column() in self.editableParameters(): 247 241 editor = QtWidgets.QLineEdit(widget) 248 validator = QtGui.QDoubleValidator()242 validator = GuiUtils.DoubleValidator() 249 243 editor.setValidator(validator) 250 244 return editor
Note: See TracChangeset
for help on using the changeset viewer.