Changeset e43fc91 in sasview for src/sas/qtgui/Perspectives/Fitting/ViewDelegate.py
- Timestamp:
- Aug 25, 2017 8:37:30 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:
- 4d1eff2
- Parents:
- b2a5042
- git-author:
- Piotr Rozyczko <rozyczko@…> (08/25/17 08:31:37)
- git-committer:
- Piotr Rozyczko <rozyczko@…> (08/25/17 08:37:30)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/ViewDelegate.py
r377ade1 re43fc91 85 85 Custom delegate for appearance and behavior control of the polydispersity view 86 86 """ 87 #POLYDISPERSE_FUNCTIONS = ['rectangle', 'array', 'lognormal', 'gaussian', 'schulz']88 POLYDISPERSE_FUNCTIONS = ['rectangle', 'lognormal', 'gaussian', 'schulz']87 POLYDISPERSE_FUNCTIONS = ['rectangle', 'array', 'lognormal', 'gaussian', 'schulz'] 88 #POLYDISPERSE_FUNCTIONS = ['rectangle', 'lognormal', 'gaussian', 'schulz'] 89 89 90 90 combo_updated = QtCore.pyqtSignal(str, int) 91 filename_updated = QtCore.pyqtSignal(int) 91 92 92 93 def __init__(self, parent=None): … … 103 104 self.poly_nsigs = 5 104 105 self.poly_function = 6 106 self.poly_filename = 7 105 107 106 108 def editableParameters(self): … … 126 128 self.poly_nsigs = 6 127 129 self.poly_function = 7 130 self.poly_filename = 8 128 131 129 132 def createEditor(self, widget, option, index): 130 133 # Remember the current choice 131 current_text = index.data().toString()132 134 if not index.isValid(): 133 135 return 0 134 if index.column() == self.poly_function: 135 editor = QtGui.QComboBox(widget) 136 for function in self.POLYDISPERSE_FUNCTIONS: 137 editor.addItem(function) 138 current_index = editor.findText(current_text) 139 editor.setCurrentIndex(current_index if current_index>-1 else 3) 140 editor.currentIndexChanged.connect(lambda: self.combo_updated.emit(str(editor.currentText()), index.row())) 141 return editor 136 elif index.column() == self.poly_filename: 137 # Notify the widget that we want to change the filename 138 self.filename_updated.emit(index.row()) 139 return None 142 140 elif index.column() in self.editableParameters(): 143 editor = QtGui.QLineEdit(widget)141 self.editor = QtGui.QLineEdit(widget) 144 142 validator = QtGui.QDoubleValidator() 145 editor.setValidator(validator)146 return editor143 self.editor.setValidator(validator) 144 return self.editor 147 145 else: 148 146 QtGui.QStyledItemDelegate.createEditor(self, widget, option, index)
Note: See TracChangeset
for help on using the changeset viewer.