Changeset d6b8a1d in sasview for src/sas/qtgui/Perspectives/Fitting


Ignore:
Timestamp:
Nov 9, 2017 6:43:56 AM (6 years ago)
Author:
Piotr Rozyczko <rozyczko@…>
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:
53c771e
Parents:
fbfc488
git-author:
Piotr Rozyczko <rozyczko@…> (11/07/17 06:29:59)
git-committer:
Piotr Rozyczko <rozyczko@…> (11/09/17 06:43:56)
Message:

More Qt5 related fixes

Location:
src/sas/qtgui/Perspectives/Fitting
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Perspectives/Fitting/FittingOptions.py

    r4992ff2 rd6b8a1d  
    8888                validator.setBottom(0) 
    8989            elif f_type == float: 
    90                 validator = QtGui.QDoubleValidator() 
     90                validator = GuiUtils.DoubleValidator() 
    9191                validator.setBottom(0) 
    9292            else: 
  • src/sas/qtgui/Perspectives/Fitting/FittingWidget.py

    rfbfc488 rd6b8a1d  
    1313from PyQt5 import QtWidgets 
    1414from 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 
    1519 
    1620from sasmodels import product 
     
    5155DEFAULT_POLYDISP_FUNCTION = 'gaussian' 
    5256 
    53 USING_TWISTED = True 
     57#USING_TWISTED = True 
     58USING_TWISTED = False 
    5459 
    5560class ToolTippedItemModel(QtGui.QStandardItemModel): 
     
    469474        menu = QtWidgets.QMenu() 
    470475        label = QtWidgets.QLabel(msg) 
    471         action = QtGui.QWidgetAction(self) 
     476        action = QtWidgets.QWidgetAction(self) 
    472477        action.setDefaultWidget(label) 
    473478        menu.addAction(action) 
     
    478483        Respond to select Model from list event 
    479484        """ 
    480         model = str(self.cbModel.currentText()) 
     485        model = self.cbModel.currentText() 
    481486 
    482487        # empty combobox forced to be read 
     
    534539        Select Category from list 
    535540        """ 
    536         category = str(self.cbCategory.currentText()) 
     541        category = self.cbCategory.currentText() 
    537542        # Check if the user chose "Choose category entry" 
    538543        if category == CATEGORY_DEFAULT: 
     
    680685            helpfile = "mag_help.html" 
    681686        help_location = tree_location + helpfile 
     687 
     688        content = QtCore.QUrl(help_location) 
    682689        self.helpView.load(QtCore.QUrl(help_location)) 
    683690        self.helpView.show() 
     
    733740            fitter = Fit() 
    734741            data = GuiUtils.dataFromItem(fit_index) 
    735             fitter.set_model(model, fit_id, params_to_fit, data=data, 
     742            try: 
     743                fitter.set_model(model, fit_id, params_to_fit, data=data, 
    736744                             constraints=constraints) 
     745            except ValueError as ex: 
     746                logging.error("Setting model parameters failed with: %s" % ex) 
     747                return 
     748 
    737749            qmin, qmax, _ = self.logic.computeRangeFromData(data) 
    738750            fitter.set_data(data=data, id=fit_id, smearer=smearer, qmin=qmin, 
     
    15221534        residuals_plot.id = "Residual " + residuals_plot.id 
    15231535        self.createNewIndex(residuals_plot) 
    1524         self.communicate.plotUpdateSignal.emit([residuals_plot]) 
     1536        #self.communicate.plotUpdateSignal.emit([residuals_plot]) 
    15251537 
    15261538    def calcException(self, etype, value, tb): 
  • src/sas/qtgui/Perspectives/Fitting/OptionsWidget.py

    r4992ff2 rd6b8a1d  
    88 
    99from sas.qtgui.Plotting.PlotterData import Data2D 
     10import sas.qtgui.Utilities.GuiUtils as GuiUtils 
    1011 
    1112# Local UI 
     
    6667 
    6768        # 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()) 
    7071        # Let only ints in the number of points edit 
    7172        self.txtNpts.setValidator(QtGui.QIntValidator()) 
  • src/sas/qtgui/Perspectives/Fitting/SmearingWidget.py

    r4992ff2 rd6b8a1d  
    88from sas.qtgui.Plotting.PlotterData import Data1D 
    99from sas.qtgui.Plotting.PlotterData import Data2D 
     10import sas.qtgui.Utilities.GuiUtils as GuiUtils 
    1011 
    1112# Local UI 
     
    5152        self.parent = parent 
    5253        # 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()) 
    5556 
    5657        # Attach slots 
  • src/sas/qtgui/Perspectives/Fitting/ViewDelegate.py

    rfbfc488 rd6b8a1d  
    44 
    55import 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 
    126 
    137class ModelViewDelegate(QtWidgets.QStyledItemDelegate): 
     
    8781        if index.column() == self.param_value: #only in the value column 
    8882            editor = QtWidgets.QLineEdit(widget) 
    89             validator = QtGui.QDoubleValidator() 
     83            validator = GuiUtils.DoubleValidator() 
    9084            editor.setValidator(validator) 
    9185            return editor 
     
    168162        elif index.column() in self.editableParameters(): 
    169163            self.editor = QtWidgets.QLineEdit(widget) 
    170             validator = QtGui.QDoubleValidator() 
     164            validator = GuiUtils.DoubleValidator() 
    171165            self.editor.setValidator(validator) 
    172166            return self.editor 
     
    246240        if index.column() in self.editableParameters(): 
    247241            editor = QtWidgets.QLineEdit(widget) 
    248             validator = QtGui.QDoubleValidator() 
     242            validator = GuiUtils.DoubleValidator() 
    249243            editor.setValidator(validator) 
    250244            return editor 
Note: See TracChangeset for help on using the changeset viewer.