Changeset ccfe03b in sasview for src/sas/qtgui
- Timestamp:
- Mar 29, 2019 6:52:16 AM (6 years ago)
- Branches:
- ESS_GUI_bumps_abstraction
- Children:
- f86343bd
- Parents:
- fec5842
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/FittingOptions.py
rfec5842 rccfe03b 27 27 _longName = None 28 28 _type = None 29 _description = None # an optional description for the user, will be shown as UI tooltip 29 30 _defaultValue = None 30 31 value = None 31 32 32 def __init__(self, shortName, longName, dtype, defaultValue ):33 def __init__(self, shortName, longName, dtype, defaultValue, description = None): 33 34 self._shortName = shortName 34 35 self._longName = longName 35 36 self._type = dtype 37 self._description = description 36 38 self._defaultValue = defaultValue 37 39 self.value = defaultValue … … 48 50 def type(self): 49 51 return self._type 52 53 @property 54 def description(self): 55 return self._description 50 56 51 57 @property … … 136 142 def __str__(self): 137 143 return "\n".join(["{}: {}".format(key, fm) for key, fm in self._methods.items()]) 144 145 from sas.sascalc.fit.BumpsFitting import toolTips as bumpsToolTips 138 146 139 147 class FittingMethodBumps(FittingMethod): … … 162 170 longName, dtype = bumps.options.FIT_FIELDS[shortName] 163 171 dtype = self._convertParamType(dtype) 164 param = FittingMethodParameter(shortName, longName, dtype, defValue) 172 key = shortName+"_"+f.id 173 descr = bumpsToolTips.get(key, None) 174 param = FittingMethodParameter(shortName, longName, dtype, defValue, 175 description=descr) 165 176 params.append(param) 166 177 self.add(FittingMethodBumps(f.id, f.name, params)) … … 308 319 for param in fm.params.values(): 309 320 row = layout.rowCount()+1 310 layout.addWidget(self._makeLabel(param.longName), row, 0) 321 label = self._makeLabel(param.longName) 322 layout.addWidget(label, row, 0) 311 323 widget = self._inputWidgetFromType(param.type, self) 312 324 if widget is None: 313 325 continue 326 if param.description is not None: 327 widget.setToolTip(param.description) 328 label.setToolTip(param.description) 329 layout.addWidget(widget, row, 1) 314 330 widgetName = param.shortName+'_'+fm.shortName 315 layout.addWidget(widget, row, 1)316 331 setattr(self, widgetName, widget) 317 332 layout.addItem(QtWidgets.QSpacerItem(0, 0, vPolicy=QtWidgets.QSizePolicy.Expanding))
Note: See TracChangeset
for help on using the changeset viewer.