Changes in / [f331852:1420066] in sasview
- Files:
-
- 7 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/FittingUtilities.py
ra95c44b r8222f171 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']144 139 def addErrorHeadersToModel(model): 145 140 """ … … 152 147 model.setHeaderData(4, QtCore.Qt.Horizontal, QtCore.QVariant("Max")) 153 148 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']161 149 162 150 def addPolyHeadersToModel(model): … … 172 160 model.setHeaderData(6, QtCore.Qt.Horizontal, QtCore.QVariant("Function")) 173 161 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']184 162 185 163 def addErrorPolyHeadersToModel(model): … … 196 174 model.setHeaderData(7, QtCore.Qt.Horizontal, QtCore.QVariant("Function")) 197 175 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']209 176 210 177 def addShellsToModel(parameters, model, index): -
src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
ra95c44b r8f2548c 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)65 52 66 53 class FittingWidget(QtGui.QWidget, Ui_FittingWidgetUI): … … 253 240 # We can't use a single model here, due to restrictions on flattening 254 241 # the model tree with subclassed QAbstractProxyModel... 255 self._model_model = ToolTippedItemModel()256 self._poly_model = ToolTippedItemModel()257 self._magnet_model = ToolTippedItemModel()242 self._model_model = QtGui.QStandardItemModel() 243 self._poly_model = QtGui.QStandardItemModel() 244 self._magnet_model = QtGui.QStandardItemModel() 258 245 259 246 # Param model displayed in param list -
src/sas/qtgui/Perspectives/Fitting/UnitTesting/FittingWidgetTest.py
rc7358b2 ra14a2b0 342 342 self.assertEqual(self.widget.lstPoly.horizontalHeader().count(), 8) 343 343 self.assertFalse(self.widget.lstPoly.horizontalHeader().stretchLastSection()) 344 345 # Test tooltips346 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])361 344 362 345 # Test presence of comboboxes in last column … … 495 478 self.assertFalse(self.widget.lstMagnetic.horizontalHeader().stretchLastSection()) 496 479 497 #Test tooltips498 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 510 480 # Test rows 511 481 for row in xrange(self.widget._magnet_model.rowCount()): … … 865 835 name_modified_param = str(self.widget._model_model.item(5, 0).text()) 866 836 867 # Check the model868 self.assertEqual(self.widget._model_model.rowCount(), 6)869 self.assertEqual(self.widget._model_model.columnCount(), 5)870 871 # Test the header872 #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 886 837 # check that the value has been modified in kernel_module 887 838 self.assertEqual(new_value, -
src/sas/qtgui/Perspectives/Invariant/InvariantDetails.py
r28cda69 r457d961 64 64 self.label_3.setStyleSheet(new_font) 65 65 self.label_4.setStyleSheet(new_font) 66 self.label_ 7.setStyleSheet(new_font)66 self.label_.setStyleSheet(new_font) 67 67 68 68 self.show()
Note: See TracChangeset
for help on using the changeset viewer.