From 001ce432e82b7f3187673ee9c48cb661f9006f06 Mon Sep 17 00:00:00 2001 From: atse Date: Wed, 19 Jul 2023 13:34:01 +0800 Subject: [PATCH] Add clear graphs context menu item --- pytec/tec_qt.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pytec/tec_qt.py b/pytec/tec_qt.py index bfa362b..05913bc 100644 --- a/pytec/tec_qt.py +++ b/pytec/tec_qt.py @@ -198,6 +198,11 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow): self.thermostat_settings.setMenu(self.menu) + clear = QtGui.QAction("Clear graphs", self.menu) + clear.triggered.connect(self.clear_graphs) + self.menu.addAction(clear) + self.menu.clear = clear + def _set_up_graphs(self): for graph in self.ch0_t_graph, self.ch0_i_graph, self.ch1_t_graph, self.ch1_i_graph: time_axis = LiveAxis('bottom', text="Time since Thermostat reset", **{Axis.TICK_FORMAT: Axis.DURATION})