MCPcopy Create free account
hub / github.com/LabPy/lantz / bind_feat

Method bind_feat

lantz/ui/widgets.py:767–780  ·  view source on GitHub ↗
(self, feat)

Source from the content-addressed store, hash-verified

765 self.change_units(request_new_units(self.value()))
766
767 def bind_feat(self, feat):
768 super().bind_feat(feat)
769
770 #: self._units are the current units displayed by the widget.
771 #: Respects units declared in the suffix
772
773 if feat.units:
774 suf = (self.suffix() if hasattr(self, 'suffix') else feat.units) or feat.units
775 self._units = Q_(1, suf)
776 self.change_units(self._units)
777 else:
778 self._units = None
779 if feat.limits:
780 self.change_limits(None)
781
782 def change_units(self, new_units):
783 """Update displayed suffix and stored units.

Callers

nothing calls this directly

Calls 3

change_unitsMethod · 0.95
change_limitsMethod · 0.95
bind_featMethod · 0.45

Tested by

no test coverage detected