Skip to content

Commit

Permalink
ENH #70 remove comments
Browse files Browse the repository at this point in the history
  • Loading branch information
rodolakis committed Feb 9, 2024
1 parent bb57f3c commit 35d7067
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions mdaviz/select_fields_table_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,16 +193,6 @@ def setCheckbox(self, index, state):
self.updateCheckboxes()
self.checkboxStateChanged.emit(self.plotFields()[0])

# def uncheckCheckBox(self, row, column_name):
# col = self.columnNumber(column_name)
# index = self.index(row, col)

# if 0 <= row < len(self._fields):
# field = self._fields[row]
# field.selection = (QtCore.Qt.Unchecked)
# # Notify views that the data has been updated.
# self.dataChanged.emit(index, index, [QtCore.Qt.CheckStateRole])

def checkCheckBox(self, row, column_name):
self.selections[row] = (
column_name # Mark the checkbox as checked by updating 'selections'
Expand Down Expand Up @@ -231,18 +221,12 @@ def clearAllCheckboxes(self):
return # No selections to clear
# Clear all selections
self.selections.clear()
# Emit the dataChanged signal for the entire table to update the view.
# Assuming you have methods to get the index of the first and last items in the model for full refresh.
topLeftIndex = self.index(0, 0)
bottomRightIndex = self.index(self.rowCount() - 1, self.columnCount() - 1)
self.dataChanged.emit(
topLeftIndex, bottomRightIndex, [QtCore.Qt.CheckStateRole]
)

# Optionally, emit a custom signal to notify other parts of your application that all selections have been cleared.
# This is useful if other UI elements or logic depend on the selection state.
self.checkboxStateChanged.emit({})

def applySelectionRules(self, index, changes=False):
"""Apply selection rules 2-4."""
row = index.row()
Expand Down

0 comments on commit 35d7067

Please sign in to comment.