Changeset 6e58f2f in sasview for src/sas


Ignore:
Timestamp:
Feb 14, 2018 2:34:31 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:
06234fc
Parents:
c736154
Message:

Code review fixes for FittingWidget?

File:
1 edited

Legend:

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

    rc736154 r6e58f2f  
    558558        """ 
    559559        selected_rows = self.lstParams.selectionModel().selectedRows() 
     560        # There have to be only two rows selected. The caller takes care of that 
     561        # but let's check the correctness. 
    560562        assert(len(selected_rows)==2) 
    561563 
     
    573575        # Function should have the model name preamble 
    574576        constraint.func = c_text 
    575  
    576         # Create a new item and add the Constraint object as a child 
    577         item = QtGui.QStandardItem() 
    578         item.setData(constraint) 
    579  
    580577        # Which row is the constrained parameter in? 
    581578        row = self.getRowFromName(constraint.param) 
    582         self._model_model.item(row, 1).setChild(0, item) 
    583         self.constraintAddedSignal.emit([row]) 
    584  
    585         # Show visual hints for the constraint 
    586         font = QtGui.QFont() 
    587         font.setItalic(True) 
    588         brush = QtGui.QBrush(QtGui.QColor('blue')) 
    589         self.modifyViewOnRow(row, font=font, brush=brush) 
    590  
    591         # Notify the user 
    592         self.communicate.statusBarUpdateSignal.emit('Constraints added') 
     579 
     580        # Create a new item and add the Constraint object as a child 
     581        self.addConstraintToRow(constraint=constraint, row=row) 
    593582 
    594583    def getRowFromName(self, name): 
     
    679668            self.modifyViewOnRow(row, font=font, brush=brush) 
    680669        self.communicate.statusBarUpdateSignal.emit('Constraint added') 
    681         pass 
    682670 
    683671    def deleteConstraint(self): 
     
    718706 
    719707        self.communicate.statusBarUpdateSignal.emit('Constraint removed') 
    720         pass 
    721  
    722708 
    723709    def getConstraintForRow(self, row): 
     
    791777        for row in self.selectedParameters(): 
    792778            self._model_model.item(row, 0).setCheckState(status) 
    793         pass # debugger hook 
    794779 
    795780    def getConstraintsForModel(self): 
     
    799784        e.g. [('sld','5*sld_solvent')] 
    800785        """ 
    801         model_name = self.kernel_module.name 
    802786        param_number = self._model_model.rowCount() 
    803787        params = [(self._model_model.item(s, 0).text(), 
     
    813797        Only for constraints with defined VALUE 
    814798        """ 
    815         model_name = self.kernel_module.name 
    816799        param_number = self._model_model.rowCount() 
    817800        params = [(self._model_model.item(s, 0).text(), 
     
    900883                    new_func = func.replace(old_name, new_name) 
    901884                    self._model_model.item(row, 1).child(0).data().func = new_func 
    902  
    903         pass 
    904885 
    905886    def updateData(self): 
Note: See TracChangeset for help on using the changeset viewer.