Changeset 6052c02 in sasview for src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
- Timestamp:
- Jul 9, 2018 12:13:03 PM (6 years ago)
- Branches:
- ESS_GUI_iss959
- Children:
- 085e3c9d
- Parents:
- 515c23df
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
re20870bc r6052c02 45 45 from sas.qtgui.Perspectives.Fitting.ViewDelegate import PolyViewDelegate 46 46 from sas.qtgui.Perspectives.Fitting.ViewDelegate import MagnetismViewDelegate 47 from sas.qtgui.Perspectives.Fitting.ViewDelegate import StructureViewDelegate 47 48 from sas.qtgui.Perspectives.Fitting.Constraint import Constraint 48 49 from sas.qtgui.Perspectives.Fitting.MultiConstraint import MultiConstraint … … 50 51 51 52 52 53 TAB_MAGNETISM = 4 54 TAB_POLY = 3 53 TAB_STRUCTURE = 3 54 TAB_POLY = 4 55 TAB_MAGNETISM = 5 56 55 57 CATEGORY_DEFAULT = "Choose category..." 56 58 CATEGORY_STRUCTURE = "Structure Factor" … … 195 197 # Enable/disable UI components 196 198 self.setEnablementOnDataLoad() 199 200 @property 201 def structureView(self): 202 return self.lstStructureOptions 197 203 198 204 def initializeGlobals(self): … … 307 313 self._poly_model = ToolTippedItemModel() 308 314 self._magnet_model = ToolTippedItemModel() 315 self._structure_model = ToolTippedItemModel() 309 316 310 317 # Param model displayed in param list … … 361 368 # Delegates for custom editing and display 362 369 self.lstMagnetic.setItemDelegate(MagnetismViewDelegate(self)) 370 371 # Structure factor options model (TEMPORARY EXAMPLE) 372 373 header_list = ["Property", "Value"] 374 num_cols = len(header_list) 375 self._structure_model.setHorizontalHeaderLabels(header_list) 376 377 self.structure_params = [ 378 "mixture", 379 "effective radius", 380 "volume fraction" 381 ] 382 383 # these are just an example 384 param_vals = [ 385 "P(Q)S(Q)", 386 "ER_mean_curvature", 387 "VR_something_or_other" 388 ] 389 390 num_SoQs = 3 391 for i in range(num_SoQs): 392 item_toplevel = QtGui.QStandardItem() 393 item_toplevel.setEditable(False) 394 item_toplevel.setText("S{}(Q)".format(i+1)) 395 396 for param, val in zip(self.structure_params, param_vals): 397 item1 = QtGui.QStandardItem() 398 item1.setEditable(False) 399 item1.setText(param) 400 401 item2 = QtGui.QStandardItem() 402 item2.setText(val) 403 404 item_toplevel.appendRow([item1, item2]) 405 406 row_toplevel = [item_toplevel] 407 for i in range(num_cols - 1): 408 item = QtGui.QStandardItem() 409 item.setEditable(False) 410 row_toplevel.append(item) 411 412 self._structure_model.appendRow(row_toplevel) 413 414 self.lstStructureOptions.setModel(self._structure_model) 415 self.lstStructureOptions.setItemDelegate(StructureViewDelegate(self)) 416 self.lstStructureOptions.setAlternatingRowColors(True) 417 self.lstStructureOptions.setStyleSheet(stylesheet) 363 418 364 419 def initializeCategoryCombo(self):
Note: See TracChangeset
for help on using the changeset viewer.