Add tooltips in parameter tree

This commit is contained in:
atse 2024-06-20 16:13:27 +08:00
parent 1340057449
commit b6692b55a4
2 changed files with 12 additions and 0 deletions

View File

@ -42,6 +42,13 @@ class MutexParameter(pTypes.ListParameter):
registerParameterType("mutex", MutexParameter) 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): class ctrl_panel(QObject):
set_zero_limits_warning_sig = pyqtSignal(list) set_zero_limits_warning_sig = pyqtSignal(list)
@ -79,6 +86,8 @@ class ctrl_panel(QObject):
self.params[i].setValue = self._setValue self.params[i].setValue = self._setValue
self.params[i].sigTreeStateChanged.connect(sigTreeStateChanged_handle) self.params[i].sigTreeStateChanged.connect(sigTreeStateChanged_handle)
set_tree_label_tips(tree)
for handle in sigActivated_handles[i]: for handle in sigActivated_handles[i]:
self.params[i].child(*handle[0]).sigActivated.connect(handle[1]) self.params[i].child(*handle[0]).sigActivated.connect(handle[1])

View File

@ -139,6 +139,7 @@
"name":"Thermistor Config", "name":"Thermistor Config",
"expanded":true, "expanded":true,
"type":"group", "type":"group",
"tip": "Configuration of the connected Thermistor",
"children":[ "children":[
{ {
"name":"T₀", "name":"T₀",
@ -155,6 +156,7 @@
"ch", "ch",
"t0" "t0"
], ],
"tip": "The origin temperature for the B-Parameter Formula",
"lock":false "lock":false
}, },
{ {
@ -169,6 +171,7 @@
"ch", "ch",
"r0" "r0"
], ],
"tip": "The origin resistance for the B-Parameter Formula",
"lock":false "lock":false
}, },
{ {