Ignore:
File:
1 edited

Legend:

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

    rf3cc979 rbb477f5  
    12191219        if model_column in [delegate.poly_pd, delegate.poly_error, delegate.poly_min, delegate.poly_max]: 
    12201220            row = self.getRowFromName(parameter_name) 
    1221             param_item = self._model_model.item(row).child(0).child(0, model_column) 
    1222             if param_item is None: 
    1223                 return 
     1221            param_item = self._model_model.item(row) 
    12241222            self._model_model.blockSignals(True) 
    1225             param_item.setText(item.text()) 
     1223            param_item.child(0).child(0, model_column).setText(item.text()) 
    12261224            self._model_model.blockSignals(False) 
    12271225 
     
    27982796 
    27992797        func = QtWidgets.QComboBox() 
     2798        # Available range of shells displayed in the combobox 
     2799        func.addItems([str(i) for i in range(param_length+1)]) 
     2800 
     2801        # Respond to index change 
     2802        func.currentIndexChanged.connect(self.modifyShellsInList) 
    28002803 
    28012804        # cell 2: combobox 
    28022805        item2 = QtGui.QStandardItem() 
    2803  
    2804         # cell 3: min value 
    2805         item3 = QtGui.QStandardItem() 
    2806  
    2807         # cell 4: max value 
    2808         item4 = QtGui.QStandardItem() 
    2809  
    2810         self._model_model.appendRow([item1, item2, item3, item4]) 
     2806        self._model_model.appendRow([item1, item2]) 
    28112807 
    28122808        # Beautify the row:  span columns 2-4 
     
    28272823            logger.error("Could not find %s in kernel parameters.", param_name) 
    28282824        default_shell_count = shell_par.default 
    2829         shell_min = 0 
    2830         shell_max = 0 
    2831         try: 
    2832             shell_min = int(shell_par.limits[0]) 
    2833             shell_max = int(shell_par.limits[1]) 
    2834         except IndexError as ex: 
    2835             # no info about limits 
    2836             pass 
    2837         item3.setText(str(shell_min)) 
    2838         item4.setText(str(shell_max)) 
    2839  
    2840         # Respond to index change 
    2841         func.currentTextChanged.connect(self.modifyShellsInList) 
    2842  
    2843         # Available range of shells displayed in the combobox 
    2844         func.addItems([str(i) for i in range(shell_min, shell_max+1)]) 
    28452825 
    28462826        # Add default number of shells to the model 
    2847         func.setCurrentText(str(default_shell_count)) 
    2848  
    2849     def modifyShellsInList(self, text): 
     2827        func.setCurrentIndex(default_shell_count) 
     2828 
     2829    def modifyShellsInList(self, index): 
    28502830        """ 
    28512831        Add/remove additional multishell parameters 
     
    28542834        first_row = self._n_shells_row + 1 
    28552835        remove_rows = self._num_shell_params 
    2856         try: 
    2857             index = int(text) 
    2858         except ValueError: 
    2859             # bad text on the control! 
    2860             index = 0 
    2861             logger.error("Multiplicity incorrect! Setting to 0") 
    28622836 
    28632837        if remove_rows > 1: 
     
    28742848        self.current_shell_displayed = index 
    28752849 
    2876         # Param values for existing shells were reset to default; force all changes into kernel module 
    2877         for row in new_rows: 
    2878             par = row[0].text() 
    2879             val = GuiUtils.toDouble(row[1].text()) 
    2880             self.kernel_module.setParam(par, val) 
    2881  
    2882         # Change 'n' in the parameter model; also causes recalculation 
     2850        # Change 'n' in the parameter model, thereby updating the underlying model 
    28832851        self._model_model.item(self._n_shells_row, 1).setText(str(index)) 
    28842852 
Note: See TracChangeset for help on using the changeset viewer.