Ignore:
Timestamp:
Aug 10, 2018 8:41:49 AM (6 years ago)
Author:
piotr
Branches:
ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
Children:
c7f259d
Parents:
a2cc8b97
Message:

Fix for frozen theories not showing correct plots. SASVIEW-978
Fix for Linear Fit not working properly after recent changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/MainWindow/DataExplorer.py

    rebfe223 r685e0e3  
    405405                self.model.beginResetModel() 
    406406                theories_copied += 1 
    407                 new_item = self.recursivelyCloneItem(outer_item) 
    408                 # Append a "unique" descriptor to the name 
    409                 time_bit = str(time.time())[7:-1].replace('.', '') 
    410                 new_name = new_item.text() + '_@' + time_bit 
    411                 new_item.setText(new_name) 
     407                new_item = self.cloneTheory(outer_item) 
    412408                self.model.appendRow(new_item) 
    413409                self.model.endResetModel() 
    414             #self.model.reset() 
    415410 
    416411        freeze_msg = "" 
     
    427422        # Actively switch tabs 
    428423        self.setCurrentIndex(1) 
     424 
     425    def cloneTheory(self, item_from): 
     426        """ 
     427        Manually clone theory items into a new HashableItem 
     428        """ 
     429        new_item = GuiUtils.HashableStandardItem() 
     430        new_item.setCheckable(True) 
     431        new_item.setCheckState(QtCore.Qt.Checked) 
     432        info_item = QtGui.QStandardItem("Info") 
     433        data_item = QtGui.QStandardItem() 
     434        data_item.setData(item_from.child(0).data()) 
     435        new_item.setText(item_from.text()) 
     436        new_item.setChild(0, data_item) 
     437        new_item.setChild(1, info_item) 
     438        # Append a "unique" descriptor to the name 
     439        time_bit = str(time.time())[7:-1].replace('.', '') 
     440        new_name = new_item.text() + '_@' + time_bit 
     441        new_item.setText(new_name) 
     442        # Change the underlying data so it is no longer a theory 
     443        try: 
     444            new_item.child(0).data().is_data = True 
     445        except AttributeError: 
     446            #no data here, pass 
     447            pass 
     448        return new_item 
    429449 
    430450    def recursivelyCloneItem(self, item): 
Note: See TracChangeset for help on using the changeset viewer.