- Timestamp:
- Oct 16, 2017 7:20:55 AM (7 years ago)
- 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:
- f331852
- Parents:
- c691d36 (diff), c7358b2 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - Location:
- src/sas/qtgui/Perspectives
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/FittingUtilities.py
r8222f171 ra95c44b 137 137 model.setHeaderData(4, QtCore.Qt.Horizontal, QtCore.QVariant("Units")) 138 138 139 model.header_tooltips = ['Select parameter for fitting', 140 'Enter parameter value', 141 'Enter minimum value for parameter', 142 'Enter maximum value for parameter', 143 'Unit of the parameter'] 139 144 def addErrorHeadersToModel(model): 140 145 """ … … 147 152 model.setHeaderData(4, QtCore.Qt.Horizontal, QtCore.QVariant("Max")) 148 153 model.setHeaderData(5, QtCore.Qt.Horizontal, QtCore.QVariant("Units")) 154 155 model.header_tooltips = ['Select parameter for fitting', 156 'Enter parameter value', 157 'Error value for fitted parameter', 158 'Enter minimum value for parameter', 159 'Enter maximum value for parameter', 160 'Unit of the parameter'] 149 161 150 162 def addPolyHeadersToModel(model): … … 160 172 model.setHeaderData(6, QtCore.Qt.Horizontal, QtCore.QVariant("Function")) 161 173 model.setHeaderData(7, QtCore.Qt.Horizontal, QtCore.QVariant("Filename")) 174 175 model.header_tooltips = ['Select parameter for fitting', 176 'Enter polydispersity ratio (STD/mean). ' 177 'STD: standard deviation from the mean value', 178 'Enter minimum value for parameter', 179 'Enter maximum value for parameter', 180 'Enter number of points for parameter', 181 'Enter number of sigmas parameter', 182 'Select distribution function', 183 'Select filename with user-definable distribution'] 162 184 163 185 def addErrorPolyHeadersToModel(model): … … 174 196 model.setHeaderData(7, QtCore.Qt.Horizontal, QtCore.QVariant("Function")) 175 197 model.setHeaderData(8, QtCore.Qt.Horizontal, QtCore.QVariant("Filename")) 198 199 model.header_tooltips = ['Select parameter for fitting', 200 'Enter polydispersity ratio (STD/mean). ' 201 'STD: standard deviation from the mean value', 202 'Error value for fitted parameter', 203 'Enter minimum value for parameter', 204 'Enter maximum value for parameter', 205 'Enter number of points for parameter', 206 'Enter number of sigmas parameter', 207 'Select distribution function', 208 'Select filename with user-definable distribution'] 176 209 177 210 def addShellsToModel(parameters, model, index): -
src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
r8f2548c ra95c44b 50 50 51 51 USING_TWISTED = True 52 53 class ToolTippedItemModel(QtGui.QStandardItemModel): 54 55 def __init__(self, parent = None): 56 QtGui.QStandardItemModel.__init__(self,parent) 57 58 def headerData(self, section, orientation, role): 59 60 if role == QtCore.Qt.ToolTipRole: 61 if orientation == QtCore.Qt.Horizontal: 62 return QtCore.QString(str(self.header_tooltips[section])) 63 64 return QtGui.QStandardItemModel.headerData(self, section, orientation, role) 52 65 53 66 class FittingWidget(QtGui.QWidget, Ui_FittingWidgetUI): … … 240 253 # We can't use a single model here, due to restrictions on flattening 241 254 # the model tree with subclassed QAbstractProxyModel... 242 self._model_model = QtGui.QStandardItemModel()243 self._poly_model = QtGui.QStandardItemModel()244 self._magnet_model = QtGui.QStandardItemModel()255 self._model_model = ToolTippedItemModel() 256 self._poly_model = ToolTippedItemModel() 257 self._magnet_model = ToolTippedItemModel() 245 258 246 259 # Param model displayed in param list -
src/sas/qtgui/Perspectives/Fitting/UnitTesting/FittingWidgetTest.py
ra14a2b0 rc7358b2 342 342 self.assertEqual(self.widget.lstPoly.horizontalHeader().count(), 8) 343 343 self.assertFalse(self.widget.lstPoly.horizontalHeader().stretchLastSection()) 344 345 # Test tooltips 346 self.assertEqual(len(self.widget._poly_model.header_tooltips), 8) 347 348 header_tooltips = ['Select parameter for fitting', 349 'Enter polydispersity ratio (STD/mean). ' 350 'STD: standard deviation from the mean value', 351 'Enter minimum value for parameter', 352 'Enter maximum value for parameter', 353 'Enter number of points for parameter', 354 'Enter number of sigmas parameter', 355 'Select distribution function', 356 'Select filename with user-definable distribution'] 357 for column, tooltip in enumerate(header_tooltips): 358 self.assertEqual(self.widget._poly_model.headerData( column, 359 QtCore.Qt.Horizontal, QtCore.Qt.ToolTipRole), 360 header_tooltips[column]) 344 361 345 362 # Test presence of comboboxes in last column … … 478 495 self.assertFalse(self.widget.lstMagnetic.horizontalHeader().stretchLastSection()) 479 496 497 #Test tooltips 498 self.assertEqual(len(self.widget._magnet_model.header_tooltips), 5) 499 500 header_tooltips = ['Select parameter for fitting', 501 'Enter parameter value', 502 'Enter minimum value for parameter', 503 'Enter maximum value for parameter', 504 'Unit of the parameter'] 505 for column, tooltip in enumerate(header_tooltips): 506 self.assertEqual(self.widget._magnet_model.headerData(column, 507 QtCore.Qt.Horizontal, QtCore.Qt.ToolTipRole), 508 header_tooltips[column]) 509 480 510 # Test rows 481 511 for row in xrange(self.widget._magnet_model.rowCount()): … … 835 865 name_modified_param = str(self.widget._model_model.item(5, 0).text()) 836 866 867 # Check the model 868 self.assertEqual(self.widget._model_model.rowCount(), 6) 869 self.assertEqual(self.widget._model_model.columnCount(), 5) 870 871 # Test the header 872 #self.assertEqual(self.widget.lstParams.horizontalHeader().count(), 5) 873 #self.assertFalse(self.widget.lstParams.horizontalHeader().stretchLastSection()) 874 875 self.assertEqual(len(self.widget._model_model.header_tooltips), 5) 876 header_tooltips = ['Select parameter for fitting', 877 'Enter parameter value', 878 'Enter minimum value for parameter', 879 'Enter maximum value for parameter', 880 'Unit of the parameter'] 881 for column, tooltip in enumerate(header_tooltips): 882 self.assertEqual(self.widget._model_model.headerData(column, 883 QtCore.Qt.Horizontal, QtCore.Qt.ToolTipRole), 884 header_tooltips[column]) 885 837 886 # check that the value has been modified in kernel_module 838 887 self.assertEqual(new_value, -
src/sas/qtgui/Perspectives/Invariant/InvariantDetails.py
r457d961 r28cda69 64 64 self.label_3.setStyleSheet(new_font) 65 65 self.label_4.setStyleSheet(new_font) 66 self.label_ .setStyleSheet(new_font)66 self.label_7.setStyleSheet(new_font) 67 67 68 68 self.show()
Note: See TracChangeset
for help on using the changeset viewer.