Ignore:
Timestamp:
Aug 25, 2017 8:37:30 AM (7 years ago)
Author:
Piotr Rozyczko <rozyczko@…>
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)
Message:

Fixed a crash when the file open dialog would lose reference to the underlying listview cell on cell losing focus SASVIEW-625

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Perspectives/Fitting/ViewDelegate.py

    r377ade1 re43fc91  
    8585    Custom delegate for appearance and behavior control of the polydispersity view 
    8686    """ 
    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'] 
    8989 
    9090    combo_updated = QtCore.pyqtSignal(str, int) 
     91    filename_updated = QtCore.pyqtSignal(int) 
    9192 
    9293    def __init__(self, parent=None): 
     
    103104        self.poly_nsigs = 5 
    104105        self.poly_function = 6 
     106        self.poly_filename = 7 
    105107 
    106108    def editableParameters(self): 
     
    126128        self.poly_nsigs = 6 
    127129        self.poly_function = 7 
     130        self.poly_filename = 8 
    128131 
    129132    def createEditor(self, widget, option, index): 
    130133        # Remember the current choice 
    131         current_text = index.data().toString() 
    132134        if not index.isValid(): 
    133135            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 
    142140        elif index.column() in self.editableParameters(): 
    143             editor = QtGui.QLineEdit(widget) 
     141            self.editor = QtGui.QLineEdit(widget) 
    144142            validator = QtGui.QDoubleValidator() 
    145             editor.setValidator(validator) 
    146             return editor 
     143            self.editor.setValidator(validator) 
     144            return self.editor 
    147145        else: 
    148146            QtGui.QStyledItemDelegate.createEditor(self, widget, option, index) 
Note: See TracChangeset for help on using the changeset viewer.