- Timestamp:
- Sep 27, 2018 4:20:24 AM (6 years ago)
- Branches:
- ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
- Children:
- 4f8c17f
- Parents:
- dce68f6
- Location:
- src/sas/qtgui
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/MainWindow/DataExplorer.py
r428c3b2 r63467b6 950 950 951 951 types = (None, Data1D, Data2D) 952 assert dimension in types 952 if not dimension in types: 953 return 953 954 954 955 for index in range(model.rowCount()): 955 956 item = model.item(index) 956 if dimension is not None and not isinstance(GuiUtils.dataFromItem(item), dimension):957 continue958 957 if item.isCheckable() and item.checkState() != mode: 959 item.setCheckState(mode) 960 # look for all children 961 for inner_index in range(item.rowCount()): 962 child = item.child(inner_index) 963 if child.isCheckable() and child.checkState() != mode: 964 child.setCheckState(mode) 958 data = item.child(0).data() 959 if dimension is None or isinstance(data, dimension): 960 item.setCheckState(mode) 961 962 items = list(GuiUtils.getChildrenFromItem(item)) 963 964 for it in items: 965 if it.isCheckable() and it.checkState() != mode: 966 data = it.child(0).data() 967 if dimension is None or isinstance(data, dimension): 968 it.setCheckState(mode) 965 969 966 970 def selectData(self, index): … … 1414 1418 current_tab_name = model_item.text() 1415 1419 for current_index in range(self.theory_model.rowCount()): 1416 #if current_tab_name in self.theory_model.item(current_index).text():1417 1420 if current_tab_name == self.theory_model.item(current_index).text(): 1418 1421 self.theory_model.removeRow(current_index) 1419 1422 break 1420 1421 1423 # send in the new item 1422 1424 self.theory_model.appendRow(model_item) -
src/sas/qtgui/MainWindow/UnitTesting/MainWindowTest.py
rfa762f4 r63467b6 54 54 tmp_main.guiManager.showWelcomeMessage() 55 55 # Assure it is visible and a part of the MdiArea 56 self.assertTrue(tmp_main.guiManager.welcomePanel.isVisible())57 56 self.assertEqual(len(tmp_main.workspace.subWindowList()), 2) 58 57 -
src/sas/qtgui/Plotting/Plotter2D.py
rdce68f6 r63467b6 284 284 new_plot.id = "Circ avg " + self.data.name 285 285 new_plot.is_data = True 286 GuiUtils.updateModelItemWithPlot(self._item, new_plot, new_plot.id) 286 if self._item.parent() is not None: 287 item = self._item.parent() 288 GuiUtils.updateModelItemWithPlot(item, new_plot, new_plot.id) 287 289 288 290 self.manager.communicator.plotUpdateSignal.emit([new_plot]) -
src/sas/qtgui/Plotting/Slicers/AnnulusSlicer.py
re20870bc r63467b6 143 143 new_plot.xtransform = "x" 144 144 new_plot.ytransform = "y" 145 GuiUtils.updateModelItemWithPlot(self._item, new_plot, new_plot.id) 145 item = self._item 146 if self._item.parent() is not None: 147 item = self._item.parent() 148 GuiUtils.updateModelItemWithPlot(item, new_plot, new_plot.id) 146 149 self.base.manager.communicator.plotUpdateSignal.emit([new_plot]) 147 150 -
src/sas/qtgui/Plotting/Slicers/BoxSlicer.py
re20870bc r63467b6 188 188 new_plot.id = (self.averager.__name__) + self.base.data.name 189 189 new_plot.is_data = True 190 GuiUtils.updateModelItemWithPlot(self._item, new_plot, new_plot.id) 190 if self._item.parent() is not None: 191 item = self._item.parent() 192 GuiUtils.updateModelItemWithPlot(item, new_plot, new_plot.id) 191 193 192 194 if self.update_model: -
src/sas/qtgui/Plotting/Slicers/SectorSlicer.py
re20870bc r63467b6 167 167 new_plot.id = "SectorQ" + self.base.data.name 168 168 new_plot.is_data = True 169 GuiUtils.updateModelItemWithPlot(self._item, new_plot, new_plot.id) 169 if self._item.parent() is not None: 170 item = self._item.parent() 171 GuiUtils.updateModelItemWithPlot(item, new_plot, new_plot.id) 170 172 171 173 self.base.manager.communicator.plotUpdateSignal.emit([new_plot]) -
src/sas/qtgui/Utilities/GuiUtils.py
r8eea1b1 r63467b6 500 500 return plot_data 501 501 502 def getChildrenFromItem(root): 503 """ 504 Recursively go down the model item looking for all children 505 """ 506 def recurse(parent): 507 for row in range(parent.rowCount()): 508 for column in range(parent.columnCount()): 509 child = parent.child(row, column) 510 yield child 511 if child.hasChildren(): 512 yield from recurse(child) 513 if root is not None: 514 yield from recurse(root) 515 502 516 def plotsFromCheckedItems(model_item): 503 517 """ … … 507 521 508 522 plot_data = [] 523 509 524 # Iterate over model looking for items with checkboxes 510 525 for index in range(model_item.rowCount()): 511 526 item = model_item.item(index) 512 513 # Going 1 level deeper only 514 for index_2 in range(item.rowCount()): 515 item_2 = item.child(index_2) 516 if item_2 and item_2.isCheckable() and item_2.checkState() == QtCore.Qt.Checked: 517 # TODO: assure item type is correct (either data1/2D or Plotter) 518 plot_data.append((item_2, item_2.child(0).data())) 519 520 if item.isCheckable() and item.checkState() == QtCore.Qt.Checked: 521 # TODO: assure item type is correct (either data1/2D or Plotter) 522 plot_data.append((item, item.child(0).data())) 527 if item and item.isCheckable() and item.checkState() == QtCore.Qt.Checked: 528 data = item.child(0).data() 529 plot_data.append((item, data)) 530 531 items = list(getChildrenFromItem(item)) 532 533 for it in items: 534 if it.isCheckable() and it.checkState() == QtCore.Qt.Checked: 535 data = it.child(0).data() 536 plot_data.append((it, data)) 523 537 524 538 return plot_data -
src/sas/qtgui/Utilities/UnitTesting/GuiUtilsTest.py
r57be490 r63467b6 195 195 # Make sure only the checked data is present 196 196 # FRIDAY IN 197 self.assertIn(test_list0, plot_list[ 1])197 self.assertIn(test_list0, plot_list[0]) 198 198 # SATURDAY IN 199 self.assertIn(test_list1, plot_list[ 0])199 self.assertIn(test_list1, plot_list[1]) 200 200 # MONDAY NOT IN 201 201 self.assertNotIn(test_list2, plot_list[0])
Note: See TracChangeset
for help on using the changeset viewer.