1
0
Fork 0
mirror of https://github.com/gwm17/spspy.git synced 2024-11-22 18:18:52 -05:00

Make tables read-only to protect from unwanted user input.

This commit is contained in:
Gordon McCann 2023-03-29 16:27:24 -04:00
parent 41781a374f
commit 1d6af4966a

View File

@ -116,6 +116,7 @@ class SpancGUI(QMainWindow):
self.tablelayout.addWidget(self.targetGroup) self.tablelayout.addWidget(self.targetGroup)
self.targetTable.resizeColumnsToContents() self.targetTable.resizeColumnsToContents()
self.targetTable.cellDoubleClicked.connect(self.handle_update_target) self.targetTable.cellDoubleClicked.connect(self.handle_update_target)
self.targetTable.setEditTriggers(QTableWidget.EditTrigger.NoEditTriggers)
def create_reaction_table(self) -> None: def create_reaction_table(self) -> None:
self.rxnGroup = QGroupBox("Reactions", self.tableTab) self.rxnGroup = QGroupBox("Reactions", self.tableTab)
@ -128,6 +129,7 @@ class SpancGUI(QMainWindow):
self.tablelayout.addWidget(self.rxnGroup) self.tablelayout.addWidget(self.rxnGroup)
self.reactionTable.resizeColumnsToContents() self.reactionTable.resizeColumnsToContents()
self.reactionTable.cellDoubleClicked.connect(self.handle_update_reaction) self.reactionTable.cellDoubleClicked.connect(self.handle_update_reaction)
self.reactionTable.setEditTriggers(QTableWidget.EditTrigger.NoEditTriggers)
def create_calibration_table(self) -> None: def create_calibration_table(self) -> None:
self.calGroup = QGroupBox("Calibration Peaks", self.tableTab) self.calGroup = QGroupBox("Calibration Peaks", self.tableTab)
@ -140,6 +142,7 @@ class SpancGUI(QMainWindow):
self.tablelayout.addWidget(self.calGroup) self.tablelayout.addWidget(self.calGroup)
self.calibrationTable.resizeColumnsToContents() self.calibrationTable.resizeColumnsToContents()
self.calibrationTable.cellDoubleClicked.connect(self.handle_update_calibration) self.calibrationTable.cellDoubleClicked.connect(self.handle_update_calibration)
self.calibrationTable.setEditTriggers(QTableWidget.EditTrigger.NoEditTriggers)
def create_output_table(self) -> None: def create_output_table(self) -> None:
self.outGroup = QGroupBox("Output Peaks", self.tableTab) self.outGroup = QGroupBox("Output Peaks", self.tableTab)
@ -152,6 +155,7 @@ class SpancGUI(QMainWindow):
self.tablelayout.addWidget(self.outGroup) self.tablelayout.addWidget(self.outGroup)
self.outputTable.resizeColumnsToContents() self.outputTable.resizeColumnsToContents()
self.outputTable.cellDoubleClicked.connect(self.handle_update_output) self.outputTable.cellDoubleClicked.connect(self.handle_update_output)
self.outputTable.setEditTriggers(QTableWidget.EditTrigger.NoEditTriggers)
def create_fit_result_text(self) -> None: def create_fit_result_text(self) -> None:
self.fitTextGroup = QGroupBox("Fit Results", self.plotTab) self.fitTextGroup = QGroupBox("Fit Results", self.plotTab)