Changeset d1ad101 in sasview for src/sas/qtgui
- Timestamp:
- Jan 8, 2019 5:44:06 AM (6 years ago)
- Branches:
- ESS_GUI, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_opencl, ESS_GUI_sync_sascalc
- Children:
- bbcf9f0
- Parents:
- 10786bc2
- Location:
- src/sas/qtgui
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/MainWindow/DataExplorer.py
r04a884a rd1ad101 640 640 # Figure out which rows are checked 641 641 ind = -1 642 # Use 'while' so the row count is forced at every iteration 642 643 deleted_items = [] 644 deleted_names = [] 643 645 while ind < self.theory_model.rowCount(): 644 646 ind += 1 645 647 item = self.theory_model.item(ind) 648 646 649 if item and item.isCheckable() and item.checkState() == QtCore.Qt.Checked: 647 650 # Delete these rows from the model 651 deleted_names.append(str(self.theory_model.item(ind).text())) 652 deleted_items.append(item) 653 648 654 self.theory_model.removeRow(ind) 649 655 # Decrement index since we just deleted it 650 656 ind -= 1 651 657 652 # pass temporarily kept as a breakpoint anchor 653 pass 658 # Let others know we deleted data 659 self.communicator.dataDeletedSignal.emit(deleted_items) 660 661 # update stored_data 662 self.manager.update_stored_data(deleted_names) 654 663 655 664 def sendData(self, event=None): … … 1810 1819 raise AttributeError(msg) 1811 1820 1812 # Check if there are any other itemsfor this tab1813 # If so, delete them1821 # Check if there exists an item for this tab 1822 # If so, replace it 1814 1823 current_tab_name = model_item.text() 1815 1824 for current_index in range(self.theory_model.rowCount()): 1816 if current_tab_name == self.theory_model.item(current_index).text(): 1817 self.theory_model.removeRow(current_index) 1818 break 1819 # send in the new item 1825 current_item = self.theory_model.item(current_index) 1826 if current_tab_name == current_item.text(): 1827 # replace data instead 1828 new_data = GuiUtils.dataFromItem(model_item) 1829 current_item.child(0).setData(new_data) 1830 return current_item 1831 1832 # add the new item to the model 1820 1833 self.theory_model.appendRow(model_item) 1834 return model_item 1821 1835 1822 1836 def deleteIntermediateTheoryPlotsByModelID(self, model_id): -
src/sas/qtgui/MainWindow/GuiManager.py
rb1626bea rd1ad101 1049 1049 Send the request to the DataExplorer for updating the theory model. 1050 1050 """ 1051 self.filesWidget.updateTheoryFromPerspective(index) 1051 item = self.filesWidget.updateTheoryFromPerspective(index) 1052 # Now notify the perspective that the item was/wasn't replaced 1053 per = self.perspective() 1054 if not isinstance(per, FittingWindow): 1055 # currently only fitting supports generation of theories. 1056 return 1057 per.currentTab.setTheoryItem(item) 1052 1058 1053 1059 def deleteIntermediateTheoryPlotsByModelID(self, model_id): -
src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
rce67f35 rd1ad101 2619 2619 """ 2620 2620 name = self.nameFromData(fitted_data) 2621 # Notify the GUI manager so it can create the theory model in DataExplorer 2622 self.theory_item = GuiUtils.createModelItemWithPlot(fitted_data, name=name) 2623 self.communicate.updateTheoryFromPerspectiveSignal.emit(self.theory_item) 2621 # Modify the item or add it if new 2622 theory_item = GuiUtils.createModelItemWithPlot(fitted_data, name=name) 2623 self.communicate.updateTheoryFromPerspectiveSignal.emit(theory_item) 2624 2625 def setTheoryItem(self, item): 2626 """ 2627 Reset the theory item based on the data explorer update 2628 """ 2629 self.theory_item = item 2624 2630 2625 2631 def nameFromData(self, fitted_data):
Note: See TracChangeset
for help on using the changeset viewer.