diff --git a/pytec/tec_qt.py b/pytec/tec_qt.py index 7989421..26fc706 100644 --- a/pytec/tec_qt.py +++ b/pytec/tec_qt.py @@ -266,10 +266,9 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow): await asyncio.gather(*[self.tec_client._command(x.format(value=data)) for x in param.opts["commands"]]) def _set_param_tree(self): - self.ch0_tree.setParameters(params[0], showTop=False) - self.ch1_tree.setParameters(params[1], showTop=False) - params[0].sigTreeStateChanged.connect(self.send_command) - params[1].sigTreeStateChanged.connect(self.send_command) + for i, tree in enumerate((self.ch0_tree, self.ch1_tree)): + tree.setParameters(params[i], showTop=False) + params[i].sigTreeStateChanged.connect(self.send_command) @pyqtSlot(list) def update_pid(self, pid_settings):