Changes in src/sas/qtgui/Perspectives/Fitting/FittingWidget.py [e00b76e:a95c44b] in sasview
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
re00b76e ra95c44b 13 13 from PyQt4 import QtWebKit 14 14 15 from sasmodels import product16 15 from sasmodels import generate 17 16 from sasmodels import modelinfo … … 53 52 54 53 class ToolTippedItemModel(QtGui.QStandardItemModel): 55 """ 56 Subclass from QStandardItemModel to allow displaying tooltips in 57 QTableView model. 58 """ 59 def __init__(self, parent=None): 54 55 def __init__(self, parent = None): 60 56 QtGui.QStandardItemModel.__init__(self,parent) 61 57 62 58 def headerData(self, section, orientation, role): 63 """ 64 Displays tooltip for each column's header 65 :param section: 66 :param orientation: 67 :param role: 68 :return: 69 """ 59 70 60 if role == QtCore.Qt.ToolTipRole: 71 61 if orientation == QtCore.Qt.Horizontal: … … 146 136 def data(self, value): 147 137 """ data setter """ 148 # Value is either a list of indices for batch fitting or a simple index149 # for standard fitting. Assure we have a list, regardless.150 138 if isinstance(value, list): 151 139 self.is_batch_fitting = True … … 161 149 162 150 # Update logics with data items 163 # Logics.data contains only a single Data1D/Data2D object164 151 self.logic.data = GuiUtils.dataFromItem(value[0]) 165 152 … … 167 154 self.is2D = True if isinstance(self.logic.data, Data2D) else False 168 155 169 # Let others know we're full of data now170 156 self.data_is_loaded = True 171 157 … … 347 333 self.chk2DView.setVisible(False) 348 334 self.chkMagnetism.setEnabled(self.is2D) 349 self.tabFitting.setTabEnabled(TAB_MAGNETISM, self.is2D)350 335 # Combo box or label for file name" 351 336 if self.is_batch_fitting: … … 359 344 # Similarly on other tabs 360 345 self.options_widget.setEnablementOnDataLoad() 361 362 # Reload the model363 self.onSelectModel()364 346 365 347 # Smearing tab … … 644 626 return 645 627 646 property_index = self._magnet_model.headerData( 0,1, model_column).toInt()[0]-1 # Value, min, max, etc.628 property_index = self._magnet_model.headerData(1, model_column).toInt()[0]-1 # Value, min, max, etc. 647 629 648 630 # Update the parameter value - note: this supports +/-inf as well … … 1056 1038 # Regardless of previous state, this should now be `plot show` functionality only 1057 1039 self.cmdPlot.setText("Show Plot") 1058 # Force data recalculation so existing charts are updated1059 self.recalculatePlotData()1040 if not self.data_is_loaded: 1041 self.recalculatePlotData() 1060 1042 self.showPlot() 1061 1043 … … 1271 1253 structure_module = generate.load_kernel_module(structure_factor) 1272 1254 structure_parameters = modelinfo.make_parameter_table(getattr(structure_module, 'parameters', [])) 1273 structure_kernel = self.models[structure_factor]()1274 1275 self.kernel_module._model_info = product.make_product_info(self.kernel_module._model_info, structure_kernel._model_info)1276 1255 1277 1256 new_rows = FittingUtilities.addSimpleParametersToModel(structure_parameters, self.is2D)
Note: See TracChangeset
for help on using the changeset viewer.