From b6692b55a491c6b3fc4f7308b4468f4ec8e51aef Mon Sep 17 00:00:00 2001 From: atse Date: Thu, 20 Jun 2024 16:13:27 +0800 Subject: [PATCH] Add tooltips in parameter tree --- pytec/view/ctrl_panel.py | 9 +++++++++ pytec/view/param_tree.json | 3 +++ 2 files changed, 12 insertions(+) diff --git a/pytec/view/ctrl_panel.py b/pytec/view/ctrl_panel.py index 9ad5a99..899f05f 100644 --- a/pytec/view/ctrl_panel.py +++ b/pytec/view/ctrl_panel.py @@ -42,6 +42,13 @@ class MutexParameter(pTypes.ListParameter): registerParameterType("mutex", MutexParameter) +def set_tree_label_tips(tree): + for item in tree.listAllItems(): + p = item.param + if "tip" in p.opts: + item.setToolTip(0, p.opts["tip"]) + + class ctrl_panel(QObject): set_zero_limits_warning_sig = pyqtSignal(list) @@ -79,6 +86,8 @@ class ctrl_panel(QObject): self.params[i].setValue = self._setValue self.params[i].sigTreeStateChanged.connect(sigTreeStateChanged_handle) + set_tree_label_tips(tree) + for handle in sigActivated_handles[i]: self.params[i].child(*handle[0]).sigActivated.connect(handle[1]) diff --git a/pytec/view/param_tree.json b/pytec/view/param_tree.json index e495b84..b08025e 100644 --- a/pytec/view/param_tree.json +++ b/pytec/view/param_tree.json @@ -139,6 +139,7 @@ "name":"Thermistor Config", "expanded":true, "type":"group", + "tip": "Configuration of the connected Thermistor", "children":[ { "name":"Tâ‚€", @@ -155,6 +156,7 @@ "ch", "t0" ], + "tip": "The origin temperature for the B-Parameter Formula", "lock":false }, { @@ -169,6 +171,7 @@ "ch", "r0" ], + "tip": "The origin resistance for the B-Parameter Formula", "lock":false }, {